You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All alternatives rely on Intl browser API, but browsers don't update TZ DB reliably. If it's important to have correct times in different timezones in your application, the only way is moment + moment-timezone now. And these projects being in maintenance mode makes me sad 😢
Anything I miss?
I see that js-joda provides some IANA DB (taken from moment-timezone?), but the package is not updated often. I could contribute with tz updates myself there, but it also depends on maintainers' possibility to apply PRs.
Despite it's being a pretty quick fix, the update was pretty late. Moreover, it looks like the process is not automated, and is done manually after an issue is being raised.
The text was updated successfully, but these errors were encountered:
I'm not sure about other date/time libraries that still bundle their own tzdb data. However, if you want full control over the dataset, you could try a hybrid approach: Use one of the many libraries that rely on Intl, but add a custom polyfill such as https://formatjs.io/docs/polyfills/intl-datetimeformat#adding-iana-timezone-database
(Note: I haven't tried this approach myself, so I can't verify its effectiveness.)
@gilmoreorless , @Schnark thank you for your advices.
I choose the polyfill and looks wonderful. Basically, I can use any library I want and add the TZ bundle on top
For somebody who can use this approach, just install npm i @formatjs/intl-datetimeformat
and in your code:
All alternatives rely on Intl browser API, but browsers don't update TZ DB reliably. If it's important to have correct times in different timezones in your application, the only way is
moment
+moment-timezone
now. And these projects being in maintenance mode makes me sad 😢Anything I miss?
I see that
js-joda
provides some IANA DB (taken frommoment-timezone
?), but the package is not updated often. I could contribute with tz updates myself there, but it also depends on maintainers' possibility to apply PRs.Just one example of the Chromium being really behind with these updates:
January 23, 2024 - news about Kazakhstan being moved to single timezone starting March 1, 2024
February 01, 2024 - IANA DB updated to 2024a including this timezone change
February 03, 2024 - moment-timezone updated to 2024a version
February 29, 2024 - the issue in Chromium about lack of Kazakhstan TZ change
March 8, 2024 - marked as fixed in Chromium tracker
And then it takes some time to get updates on the client side.
Despite it's being a pretty quick fix, the update was pretty late. Moreover, it looks like the process is not automated, and is done manually after an issue is being raised.
The text was updated successfully, but these errors were encountered: