A bug which is only a bug five days out of the year

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • Luxon

    ⏱ A library for working with dates and times in JS

  • You should never, ever do date math naively like this. There are too many unexpected edge case, especially between time zones or daylight savings time or leap years, but even without them: https://moment.github.io/luxon/#/math

    In fact I would strongly argue you should never use the JS Date built-in at all because they are terrible. Use a library like Luxon or date-fns. As a frontend dev, this is the most common category of bugs I've dealt with in my career, and I've spent dozens of hours fixing other people's datetime handling because of how poorly implemented the JS Date API is. It's full of minefields and gotchas.

    The Temporal API is supposed to fix some issues, but that's been in development for like a decade now.

  • oli-torus

    Next Generation OLI Authoring and Delivery Platform

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • yui2

    Discontinued YUI 2.x Source Tree

  • Very relatedly, there's a potential similar footgun related to hours, due to the fact that dates initialized without hour default to 00:00 in your local timezone.

    It's possible then to change the date, and the time will jump to 23:00 due to timezone DST changes.

    Example bug I had in 2014 when Russian timezone definitions have changed:

    https://github.com/yui/yui2/pull/15

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts