3 ms·
I spent a day fighting with date-fns trying to get some date calculations working and was to the point I was questioning if my entire approach was flawed becaus
by SkyBelow 2y ago
I spent a day fighting with date-fns trying to get some date calculations working and was to the point I was questioning if my entire approach was flawed because there was no reason I should be spending that much time figuring our some simple date calculations. Eventually I decided to try swapping to Luxon. 30 minutes later and it was all working.
I'm still guessing I misunderstood something fundamental about date-fns, but for now I'm advocating for Luxon.
- Macha 2y agoFor the longest time date-fns approach to timezones was "Do you really need timezones? Aren't UTC offsets enough?" which was pretty fatal for a date time library, no matter how simple and light it makes your bundle. It looks like they did finally launch TZ support in September last year, and I haven't investigated it (and probably never will, given Temporal is coming a Temporal polyfill seems a better option)
- agos 2y agodate-fn's gaslighting on timezones was so weird. I now see that they're planning duration support, but it's clear that its usefulness is fading