OED icon indicating copy to clipboard operation
OED copied to clipboard

replace moment

Open huss opened this issue 4 years ago • 3 comments

The moment project has decided to wind down and recommends replacements (https://momentjs.com/docs/#/-project-status/recommendations). There are other packages and we could wait for JS to formalize its own version. While moment works, we need to change sometime.

huss avatar Mar 02 '21 18:03 huss

PR #760 demonstrated some of the changes needed to convert to day.js. It has been closed since we need to decide what will be used as a replacement. However, that PR is useful in thinking about this and for the actual change.

huss avatar Jun 06 '22 16:06 huss

After doing some research, native javascript support for date/time, as well as durations, is a currently proposed change in the form of Temporal (https://github.com/tc39/proposal-temporal).

Temporal is currently in the stage 3 proposal phase, which means that there are unlikely to be changes to the API before it gets released. Using a polyfill, we could use this package now, even without web browser support.

Since moment still works and this feature is still in the proposal phase, there are no urgent reasons to switch over now. However, it also makes no sense to switch to another package, such as day.js or Luxon, when support for these features is close to being supported natively.

spearec avatar Jul 26 '23 20:07 spearec