cawolfkreo / Cease-and-Desist-History-Big-N

Visit the website: https://www.suedbynintendo.com/
MIT License
9 stars 1 forks source link

Site doesn't work properly in Safari #61

Closed ezhevita closed 2 years ago

ezhevita commented 2 years ago

After opening the website no events are displayed, since Safari struggles with parsing JSON file with them:

Screenshot 2022-11-03 at 18 40 08

There is the corresponding error message in the developer console:

[Error] Unhandled Promise Rejection: RangeError: date value is not finite in DateTimeFormat format()
    format (main.js:241)
    (anonymous function)
    createDataCell (main.js:241)
    map
    updateGrid (main.js:263)
    (anonymous function) (main.js:278)
    asyncFunctionResume
    (anonymous function)
    promiseReactionJobWithoutPromise
    promiseReactionJob

The first record that caused this error was this one: https://github.com/cawolfkreo/Cease-and-Desist-History-Big-N/blob/60b4dff9a84e0d7bdf625231d637d0599c3025fe/data/data.json#L37-L43

Apparently, Safari does not tolerate a single-digit month number and throws an error while trying to parse it.

cawolfkreo commented 2 years ago

The simplest solution here, without using some external library, as you can guess, is updating every date to apply the full "YYYY-MM-DD" format instead of having this mix of dates. I'll do this after work later today, thank you for telling me about this!!

Note to anyone in the future who might see this and it's looking for a solution, Apparently Safari is a bit of a diva when it comes to parsing dates and it is important to have the full date in the ISO8601.

ezhevita commented 2 years ago

may I contribute and do this myself? I know this ain't much, but it's honest work!

cawolfkreo commented 2 years ago

Yes you may!! and I would love you for it. Just make a PR of your branch and add me as a reviewer before submitting!