The issue I'm having is that Chrome and IE/Edge give different results serializing certain JavaScript datetimes to JSON - for example summer of 1945 in the UK.
I have a JavaScript object containing a Date type set via a calendar component which sets time to midnight local time. This object is serialized via JSON.stringify which in turn uses Date.toJSON which in turn uses Date.toISOString.
If I have a local datetime of say 1st May 1977 in my UK locale, this serializes to "1977-04-30T23:00:00.000Z", i.e. UTC 11pm 30th April 1977. This is fine, however if I start with local 1st May 1945, I end up with different results using Chrome vs IE/Edge. Chrome correctly gives me "1945-04-30T22:00:00.000Z". The reason this is 10pm rather than 11pm is because the UK operated double daylight savings time during WW2.
IE/Edge however subtracts one hour meaning the JSON UTC datetime string is out by an hour.
What this means for me is that I cannot trust the JSON serialized data passed back to the server unless I know which browser it came from.
I'm contemplating overriding Data.prototype.toJSON to change the serialization to something based on local time, but including the timezone offset, such as "1945-05-01T00:00:00.000+0200". At least then I know what the user actually intended. However this does seem a bit extreme and wonder if I'm missing something. JSON.stringify is the usual method for serializing data to be shipped to a server, but this whole mechanism seems flawed.