Earlier 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.
Day.js – Fast 2kB alternative to Moment.js with the same modern API
21–30 of 141 posts
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#22Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#23Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#24Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#25That's the only real issue for me with Moment and I'm not sure this lib would change that... especially if I need to extend it for various uses every time it's called, which for me would be a rather large drawback that would end up polluting lots of modules with extra lines of code for specific date comparison purposes.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#26Checked some of the popular sites (caching enabled)-
Amazon.com - 4.8MB
Google.com - 2.5MB
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#27I just use what the native Date() object offers.
Other devs always say "Just wait, one day it will fall on your feet".
But this has been going on for many years, in which my software has served millions of users and nothing ever fell on my feet. I think the complexity of a library like this (423 files, 1433 commits, 53004 lines of code) would have created more problems during this time. So not using one is a net positive.
Any minimal code example of what is prone to break without a date library and how this date library is supposed to prevent it?
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#28What is the obsession with xKB? With tracking, analytics, monitoring and gazillion other scripts, I'd wager that an average webpage size is probably closer to 1MB. Checked some of the popular sites (caching enabled)- Amazon.com - 4.8MB Google.com - 2.5MB
Hosting is cheaper.
Re: Day.js – Fast 2kB alternative to Moment.js with the same modern API
#29I never use any date library and I never had a problem with it. I just use what the native Date() object offers. Other devs always say "Just wait, one day it will fall on your feet". But this has been going on for many years, in which my software has served millions of users and nothing ever fell on my feet. I think the complexity of a library like this (423 files, 1433 commits, 53004 lines of code) would have create…
- https://infiniteundo.com/post/25326999628/falsehoods-program...
- https://infiniteundo.com/post/25509354022/more-falsehoods-pr...
In my experience engineers will often brush these sorts of things off as “edge cases”, but really all of these complexities are just how dates and time work in the real life (I’d argue that they’re just “normal cases” to test for)… So any anomaly in software will cause real problems of varying importance for users.