Second, it's genuinely a set of functions. You import whatever functions you want and use them with the Date objects. Yes, yes, you got it right, tree-shaking out-of-the-box! Your production bundle will include only the functions you export and used.
On their website, they mention a few more perks, which are fantastic! Typescript support, immutable by default, consistent with timezones, internationalization & localization support (with tree-shaking as well!), and more goodies.
The community is already pretty big with 181 contributors, including financial contributors, among them you can also find Addy Osmani.
Please note that we import only functions and provide them with a regular js date object.
To achieve the same with moment.js:
This time we have to import the moment function, which creates a new object with all momentjs functionality. It means no tree-shake, and we cannot use js date object. We must convert it to a momentjs object first.
I think that's all you need to know to give it a try and see if you like it.
I want to thank the moment.js team from the bottom of my heart! ❤️