-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace moment dependency with a modern library #55
Comments
In reality this project relies heavily on moment-timezone. The important data here is the reliability on the timezone which uses data from IANA time zone database that is maintained and up to date. Unfortunately moment-js is required for using moment-timezone. I understand the current moment project status and the need to move to some other library instead. Nonetheless I fear that this will cause major drawbacks with the accuracy. The IANA Database is usually maintained by the underlying OS. In case of nodeJS the timezone database seams to be queried by the included ICU library.
IMO Luxon or date-fns will suffer from this design decision. If used in the browser, things tend to be worse.
With moment-timezone it can be accomplished that the timezone-data is accurate amongst all clients and platforms. This is something I don't want to trade with tickets stating that this and that date is wrong, but in reality timezone data on that client is outdated. I am following the Temporal.ZonedDateTime Proposal which I would consider as a replacement for moment-timezone. But again we'd need to see where to get really up to date timezone data amongst all clients using this library. Maybe you are aware of a JS-project which uses IANA timezone data and offers this in a "tiny" library. |
Thanks for your thorough explanation. This should clear things up for everyone (including me) wondering why we are stuck with moment. Unfortunately I am not aware of any alternatives myself. date-holidays works great, but I am getting errors when using it in the browser due to moment not supporting ESM. And since moment won't be updated, the best solution seems to be to find a suitable replacement for it. |
seems like date-fns is the best pick. |
Moment is now considered a legacy project:
https://www.npmjs.com/package/moment
There have been multiple PR's already:
#53
#48
#2
It would be nice if @commenthol could clarify which newer library should best be used.
The text was updated successfully, but these errors were encountered: