News for hackers. Stuff that matters.
Re:Day.js Fast 2kB alternative to Moment.js with the same mo... by 9wzYQbTYsAIc on Sunday October 09, 2022 @04:05AM (#33139015)
At some point you will need to calculate how many leap years to account for and whether or not a leap second was introduced in between two arbitrary times.

Time libraries can help you with that.

Re:Day.js Fast 2kB alternative to Moment.js with the same mo... by forty on Sunday October 09, 2022 @06:01AM (#33139535)
Exactly there is the same problem, to a lesser extend, when adding/subtracting years which is not trivial to do properly.
Re:Day.js Fast 2kB alternative to Moment.js with the same mo... by 9wzYQbTYsAIc on Sunday October 09, 2022 @06:10AM (#33139575)
Let alone determining requirements for thresholds.

This discussion reminds me of this bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1715455

Re:Day.js Fast 2kB alternative to Moment.js with the same mo... by ponyous on Sunday October 09, 2022 @08:31AM (#33140397)
Why can’t you use Date.getFullYear with setFullYear?