Day.js – Fast 2kB alternative to Moment.js with the same modern API
1–10 of 141 posts
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#2not bad, a quick skim of the repo shows that the locale file sizes might be 50% or less as compared to Moment.js - approx. 1 kB per locale from day compared to 2+ kB per locale from moment
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#3Why is this good/better compared to date-fns?
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#4Why 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
#5Very 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
#6It'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.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#7I 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)
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#8[deleted]
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#9It'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
#10I 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