

Thus, it might make sense to continue using Moment throughout your project rather than including yet another date and time library. If you are using such a component and cannot find an alternative, then you are already including Moment in your project. Several other libraries, especially date pickers and graphing libraries, take Moment as a dependency. However, Day.js reports compatibility with IE8 and higher so you still may wish to consider that alternative. If you have a strong requirement to support older browsers, then you might want to stick with Moment for a bit longer. Other libraries have also had issues with Safari, especially on mobile devices. You can read more in Luxon's documentation. By contrast, Luxon only works on IE 10 and higher and requires a polyfill to do so. Moment works well on Internet Explorer 8 and higher. However there are some possible reasons you might want to keep using it. In most cases, you should not choose Moment for new projects.

If one needs internationalization or time zone support, Moment can get quite large. Moment doesn't work well with modern "tree shaking" algorithms, so it tends to increase the size of web application bundles. Since this has already been accomplished in other libraries, we feel that it is more important to retain the mutable API.Īnother common argument against using Moment in modern applications is its size. We address it in our usage guidance but it still comes as a surprise to most new users.Ĭhanging Moment to be immutable would be a breaking change for every one of the projects that use it.Ĭreating a "Moment v3" that was immutable would be a tremendous undertaking and would make Moment a different library entirely.

This is a common source of complaints about Moment. Given how many projects depend on it, we choose to prioritize stability over new features.Īs an example, consider that Moment objects are mutable. Moment has evolved somewhat over the years, but it has essentially the same design as it did when it was created in 2011. The modern web looks much different these days.

Moment.js has been successfully used in millions of projects, and we are happy to have contributed to making date and time better on the web.Īs of September 2020, Moment gets over 12 million downloads per week! However, Moment was built for the previous era of the JavaScript ecosystem.
