Member-only story
Stop using Moment.js for Dates — This is the Better Alternative

Working with the Date object in JavaScript can be a real hassle! If you’re not using a ready-made date library, you can look forward to spending a lot of hours being frustrated.
Lucky for us developers, there are awesome people doing libraries to make working with dates in JavaScript much easier. One of the popular choices in this category is Moment.js In many years, this has been the go-to library for developers when working with dates. Unfortunately, Moment.js comes with a lot of overhead and drawbacks. Among others, it has a huge bundle size which will slow down your application a lot.
The people behind Moment.js are even advising against using it.
We now generally consider Moment to be a legacy project in maintenance mode. It is not dead, but it is indeed done.
Considering using Moment in your project? There may be better modern alternatives.
from https://momentjs.com/
So if you should stop using Moment.js, which library should you then be using you might ask.
There are a lot of alternatives out there to Moment.js.