Skip to content

Instantly share code, notes, and snippets.

@nativescript-oss
Last active January 1, 2025 06:29
Show Gist options
  • Select an option

  • Save nativescript-oss/26fcd158f452e0efbcdb40fa448f2a10 to your computer and use it in GitHub Desktop.

Select an option

Save nativescript-oss/26fcd158f452e0efbcdb40fa448f2a10 to your computer and use it in GitHub Desktop.
Happy New Year 2025 πŸŽ‡ πŸŽ‰
if (__ANDROID__) {
const androidDate = java.time.LocalDate.of(2025, 1, 1);
} else if (__APPLE__) {
const comp = NSDateComponents.new();
comp.year = 2025;
comp.month = 1;
comp.day = 1;
const appleDate = NSCalendar.currentCalendar.dateFromComponents(comp);
}
const jsDate = new Date(2025, 0, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment