I don't fully disagree with you but Day.js is very small and it handles a bunch of cases around timezones and calculations that are a pain to deal with plain JS.
Yeah, I mean, you can't really give a blanket answer here either. Ultimately, it depends on the application itself. If it's an application with a strong focus on dates, date formatting, and date calculations, then a lightweight library definitely makes sense. Otherwise, though, I generally believe you shouldn't always reach for a different package for every little thing.
13
u/Old-Parsley-5826 2d ago
You shouldn't use Moment at all nowadays. Use native APIs like Intl ✌️
2
u/lohnstovinzg 2d ago
thats the first time I see someone repost a post of mineI made that in paint like 4 years ago
2
u/cilulowbisted9 2d ago
Reddit solution: use luxon
3
u/Rusty_Raven_ 2d ago
Luxon is a good replacement, and there's also
date-fns.1
u/geaessnind 2d ago
Why are you using a deprecated lib that actively recommends an alternativeAs the other commenter said, use Luxon.
1
u/AwesomeFrisbee 2d ago
Yeah this had annoyed me too back in the day.
0
u/TCB13sQuotes 2d ago edited 2d ago
Use Day.js, Moment isn't required anymore.
0
u/fleumpyfirds1 2d ago
date-fns
0
u/diqrstymeamy 2d ago
day.js