3 ms·
I wrote a tiny library, tzjs, for exactly this reason. Modern browsers have built-in timezone support via window.Intl. It's actually pretty nice! One glaring o
by dcposch 8y ago
I wrote a tiny library, tzjs, for exactly this reason.
Modern browsers have built-in timezone support via window.Intl. It's actually pretty nice! One glaring omission in the spec: given (UTC instant, tzname), there is no clean way to get that offset for that timezone at that moment.
tzjs works around this omission. This saves a lot of bundle space. moment-timezone includes the whole tzdata dataset: https://bundlephobia.com/result?p=moment-timezone@0.5.21 https://bundlephobia.com/result?p=moment-timezone@0.5.21
https://github.com/dynasty-com/tzjs https://github.com/dynasty-com/tzjs