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

Visit the website: https://www.suedbynintendo.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Site doesn't work properly in Safari

ezhevita opened this issue · comments

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:

{
"url": "https://www.eurogamer.net/articles/2022-03-03-steam-deck-nintendo-emulation-videos-are-disappearing-from-youtube",
"icon":"block.svg",
"date":"2022-3-03",
"name":"Steam Deck videos removed by Nintendo",
"description": "Videos on Youtube showing the Steam Deck (Valve's first handheld console) emulating Switch games, were apparently taken down by Nintendo."
},

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

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.

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

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!