-
Notifications
You must be signed in to change notification settings - Fork 24
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
Find alternative to moment.js #191
Comments
https://github.com/you-dont-need/You-Dont-Need-Momentjs might be an option? |
Yeah, I guess we should do the "Identify where moment.js is used" task first. |
Moving this to later this year as we would like to use the new date picker implementation from the design system. The date picker is currently not top priority on neither backlogs, so waiting is fine. cc: @mrosvik |
We've added a |
Just for info, not a strong recommendation by any means: In a previous project the team moved from moment.js to day.js, and that was very easy to do. Exactly the same API, so fixed most of it using Find and replace "momen()" with "dayjs()" (and imports). |
Yeah, also according to the recommendations from the moment team, Day.js seems like the simplest replacement. Are there any good reasons for not just doing that? |
I am not sure if this is a show stopper, but the only thing I can think of at the top of my head is i18n and different date formatting for different locales. We support essentially any language in our apps, and would therefore have to preload every known locale (or default to norwegian/english for ones we decide to not support). I guess we might be able to solve this with code splitting and dynamically loading locales, but I think that might be a bit complex. If we were able to rely on the native browser Intl API instead, we could be able to support any locale, but I am not sure if we can use this API to replace our current usage of moment. |
Description
As moment.js has nearly declared itself dead (https://momentjs.com/docs/#/-project-status/)
We should find an alternative project to handle date/time in app-frontend.
Some alternatives may be: https://blog.logrocket.com/4-alternatives-to-moment-js-for-internationalizing-dates/
Acceptance criteria
A viable alternative is identified and has replaced moment.js where used.
Specification tasks
Development tasks
Definition of done
Verify that this issue meets DoD (Only for project members) before closing.
The text was updated successfully, but these errors were encountered: