-
Notifications
You must be signed in to change notification settings - Fork 184
Home
Spacetime is a small-and-punchy dateTime library, which hopes to make it easier to work with remote timezones in javascript on both client-and-serverside.
It is based, with love, on moment-timezone.
all timezone details are political, subject to change, and historically-sensitive. Spacetime ignores that America/Dawsons_Creek may have had different timekeeping in the 1600's, and may change rules in future decades.
If you're in London, and you set the timezone to be in Paris, it is intuitive that you travel 1 hour 'to the right'. But if you're in Pacific/Fiji
(right side of the map), and you goto Pacific/Midway
(left side of the map), .goto()
will subtract a tonne of hours, instead of just adding one. The .goto()
method will never pass the international date line, because the method will always respect the idea of 'now over-there', instead of some kind of geographical-movement.
spacetime doesn't depend on, but works better with the Internationalization API, which has high-support.
Something this tricky is going to have bugs 🐛. If you are scheduling heart-surguries, or landing spacecraft, please use a library with more institutional hardening.
🌠 - - - - - spacetime.how