• call_me_xale@lemmy.zip
    link
    fedilink
    arrow-up
    81
    arrow-down
    1
    ·
    1 year ago

    Bold of you to assume no one will come up with a replacement date library rather than just getting rid of JS.

    • ARk@lemm.ee
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      reserve me tickets for the inevitable shit show that follows 🍿

  • viking@infosec.pub
    link
    fedilink
    arrow-up
    27
    arrow-down
    2
    ·
    1 year ago

    What people fail to see is that this is the largest date the API can store, not a magical cutoff date in the distant future.

    You could create a date today and send it to the API, and it could potentially crash it, or create a buffer overrun.

    • Redkey@programming.dev
      link
      fedilink
      arrow-up
      8
      ·
      1 year ago

      The definition of the Date object explicitly states that any attempt to set the internal timestamp to a value outside of the maximum range must result in it being set to “NaN”. If there’s an implementation out there that doesn’t do that, then the issue is with that implementation, not the standard.

  • Turun@feddit.de
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    1 year ago

    That’s because this is the maximum integer that can be stored in a double precision floating point number without loss of precision, lol

    • interolivary@beehaw.org
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      That’s one thing that really bugs me about Javascript (weirdly enough I’m okay with eg prototypal inheritance and how this works, or at least worked before the bolted on classes that were added because apparently I’m like one of the dozen or so people who had no problems with those concepts). The fact that all numbers are floats can lead to a lot of fun and exciting bugs that people might not even realize are there until they suddenly get a weird decimal where they expected an integer

  • Alien Nathan Edward@lemm.ee
    link
    fedilink
    arrow-up
    13
    ·
    1 year ago

    I’ve got a bunch of freeze dried food from my backpacking days. Who wants to jump in on a business selling Y275.76K Survival Kits?

      • 14th_cylon@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        it may or may not be a monday - probably won’t. it will be monday based on the (4000 | year) => !(leap year) rule, but by the year 275000 the difference will be so big that i am pretty sure people will make more rules to solve that.

    • SuperJetShoes@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      1 year ago

      This will be a tough one to fix. There must be millions upon millions of embedded systems out there with 16-bit epoch burned in.

      They’ll all be much tougher to find than “YEAR PIC(99)” in COBOL was.

      Y2K wasn’t a problem because thousands upon thousands of programmers worked on it well in advance (including myself) we had source code and plenty of static analysis tools, often homegrown.

      The 2038 bugs are already out there…in the wild…their source code nothing but a distant dream.