Open huss opened 3 years ago
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.
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.
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.