Well, here is an announcement that probably won’t surprise anyone who has used Moment in the last few years, especially trying to get the size of it down in your Webpack configuration. The Moment.js team has announced it is now a legacy project in maintenance mode.
The Moment team poetically declares, “We now generally consider Moment to be a legacy project in maintenance mode. It is not dead, but it is indeed done.” Which means, we’ll fix any serious issues (security concerns, etc) but new features or changes are off the table.
I moved over to date-fns quite a long time ago which I equate to being the Lodash of date libraries. It’s small, tree shakeable and can work with the Intl API for internationalisation. Moment.js hasn’t really been a viable option for most circumstances for a few years now.
Moment came at a time where the Javascript ecosystem definitely needed a date/time library, for quite a long time, Moment was as good as it was going to get. Fortunately, browsers and working groups have evolved to the point where dates and times (while still not easy) are a lot easier than they were. The lack of tree shaking is one of the biggest downsides to Moment.
Just like jQuery greatly contributed to modern Javascript API’s, Moment has been instrumental in highlighting the importance and providing a stepping stone for developers to feel less pain working with dates and times, especially timezones. RIP Moment.js.
Worth mentioning that in the original MomentJS article, they mention a couple of alternatives (including date-fns).