I have not used moment.js or other date libraries in a long while. But how does this compare to Luxon? ( https://moment.github.io/luxon/#/why )
Luxon is my preferred library
Day.js – Fast 2kB alternative to Moment.js with the same modern API
11–20 of 141 posts
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#12Why is this good/better compared to date-fns?
Smaller bundle size, similarity to moment.js As a dev who’s used all three, is there a massive difference? Not really. Stick with what you like (though moment is no longer maintained so maybe not that)
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#13Earlier quoted context omitted.
Luxon is my preferred library
But how does this compare to Luxon, besides it being the preferred library of blahyawnblah?
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#14Earlier quoted context omitted.
But how does this compare to Luxon, besides it being the preferred library of blahyawnblah?
https://terodox.tech/migrating-away-from-momentjs-part1/
Interesting, Luxon seems to be the only library in that article using Intl [1] for locales
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#15It's embarrassing we never evolved the date api which comes with the browser. That said, I tend to err on writing a custom function / importing only a custom function over importing an entire library just to run a 2 lines function.
The new Temporal API in JS is precisely that.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#16Very awesome to see Moment JS have a legacy. What a great api
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#17Why is this good/better compared to date-fns?
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#18Earlier quoted context omitted.
The new Temporal API in JS is precisely that.
Yeah, but that’s been just a proposal for a long time. Getting new features in JS takes forever.
It’s literally final pending commitments from/to another standards body. If they hadn’t made that commitment there’d be people chastising them for something else. I swear to fuck, we can’t have nice things because no one will ever accept having nice things.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#19It's embarrassing we never evolved the date api which comes with the browser. That said, I tend to err on writing a custom function / importing only a custom function over importing an entire library just to run a 2 lines function.
The new Temporal API in JS is precisely that.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#20I have not used moment.js or other date libraries in a long while. But how does this compare to Luxon? ( https://moment.github.io/luxon/#/why )
Dayjs has the familiar momentjs API.
Both libraries have the greatest differentiating feature from moment: immutable objects. Being able to compose dayjs objects together without fear of modifying them afterwards makes everything a breeze.