The Date object's API is not rich enough, I like to think of it as the assembler to these libraries C.
In other words, most of them use it at their core, but they add several layers of abstraction in order to help make your code more readable and easier to maintain.
You can't do that with the Date object using that syntax, in fact, there are no methods to add or substract anything to its original value. The fact that there are so many libraries out there I think is literally proof that Date is not getting the job done.
Software engineer primarily focused on frontend development. I write about new things that I have learnt and some processes that I use a lot that I'd like to remember more often.
So guessing from the example that it primarily helps with the readability of complex date calculations rather than the readability of a date string. I haven't had to use a package for dates in any of the projects I've worked on so genuinely interested what the decision rational is and what Date doesn't do that forces developers to create packages for that functionality.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The Date object's API is not rich enough, I like to think of it as the assembler to these libraries C.
In other words, most of them use it at their core, but they add several layers of abstraction in order to help make your code more readable and easier to maintain.
Look at the example from the MomentJS section:
You can't do that with the Date object using that syntax, in fact, there are no methods to add or substract anything to its original value. The fact that there are so many libraries out there I think is literally proof that
Date
is not getting the job done.So guessing from the example that it primarily helps with the readability of complex date calculations rather than the readability of a date string. I haven't had to use a package for dates in any of the projects I've worked on so genuinely interested what the decision rational is and what Date doesn't do that forces developers to create packages for that functionality.