3 ms·
also, for the love of God, if you do any sort of date manipulation, just suck it up and use moment.
by virtue3 7y ago
also, 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.