5 ms·
(In javascript, because you can standard library). So yes, you do.
by fake-name 7y ago
(In javascript, because you can standard library).
So yes, you do.
- virtue3 7y agoalso, for the love of God, if you do any sort of date manipulation, just suck it up and use moment.
- Aeolun 7y agoMoment is huge though.
- jamwaffles 7y agoI've used date-fns (https://date-fns.org/ https://date-fns.org/) with good success. The import structure allows for pretty good tree shaking. It's really good if you only want to format a date in like 2 places in a huge app - don't need to pull in the entire library for that.
- villek 7y agoI recently replaced moment (which is huge like others mentioned) with luxon (https://moment.github.io/luxon/ https://moment.github.io/luxon/). It has pretty much all the same functionality but a way smaller size.
- enlyth 7y agoMoment is huge, its performance sucks and the mutability makes developers shoot themselves in the foot constantly. Trust me there are much better alternatives.
- untog 7y agoFor the love of God if you’re in the browser don’t use moment. It’s bulky and slow. Use date-fns and selectively import the functionality you’re actually using.
- yen223 7y agoNote that date-fns right now doesn't have great support for duration calculations: https://github.com/date-fns/date-fns/issues/284 https://github.com/date-fns/date-fns/issues/284 I wound up switching to Luxon because of this. Which is too bad, because date-fns is a fine library otherwise.
- Jonnax 7y agoNormally when people say library they don't mean the built in libraries for a language but external packages.
- sshine 7y agoStill, the title is overselling the post.