Re:Dates and Times in JavaScript – A New API for Dates from ...
by kcorbitt on Thursday July 09, 2020 @01:51PM
(#23782930)
https://date-fns.org/ is the most popular alternative to moment-js, has an intuitive functional API and treats dates as immutable. I migrate every project I touch over to it since it has so many fewer footguns.
[ Parent
| on HN ]
Re:Dates and Times in JavaScript – A New API for Dates from ...
by pyrhho on Friday July 10, 2020 @07:26AM
(#23790391)
I wanted to use date-fns on the current project. But, the gotcha is due to its lack of timezone support many of its functions are inherently broken (e.g. startOfWeek). So, if you need rich calculations with timezone support watch out!
Re:Dates and Times in JavaScript – A New API for Dates from ...
by erichurkman on Thursday July 09, 2020 @05:11PM
(#23785278)
+1 for date-fns. It's not uncommon to look at a downloads in a JavaScript bundle to find out Moment — and its timezone and localization files — are a huge percentage of a download for a single `moment.format()` call.