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.
14
u/Old-Parsley-5826 4d ago
You shouldn't use Moment at all nowadays. Use native APIs like Intl ✌️
2
u/lohnstovinzg 4d ago
thats the first time I see someone repost a post of mineI made that in paint like 4 years ago
2
u/cilulowbisted9 4d ago
Reddit solution: use luxon
3
u/Rusty_Raven_ 4d ago
Luxon is a good replacement, and there's also
date-fns.1
u/geaessnind 4d ago
Why are you using a deprecated lib that actively recommends an alternativeAs the other commenter said, use Luxon.
1
u/AwesomeFrisbee 4d ago
Yeah this had annoyed me too back in the day.
0
u/TCB13sQuotes 4d ago edited 4d ago
Use Day.js, Moment isn't required anymore.
0
u/fleumpyfirds1 4d ago
date-fns
0
u/diqrstymeamy 4d ago
day.js