I am currently making a series of REST calls to a backend API and I have no control over the format of the date being sent back in the JSON.
The format that is being sent is this
Wed, 21 Nov 2018 03:00:00.000Z
IE11 considers this an invalid date. I have been using moment.js to get the current date and time and comparing it to the date and time being sent in the API. It is working perfectly everywhere except in IE. I have been trying everything I can from the Moment docs but everything that I return is considered invalid by IE11.
I am setting my date as follows
var date = new Date("Wed, 21 Nov 2018 03:00:00.000Z");
Update: I have also tried setting the date using moment
var date = "Wed, 21 Nov 2018 03:00:00.000Z"
date = moment(d, "YYYY-MM-DD HH:mm:ss").toDate();
I have tried many different formats and everything returns invalid.
This is what returns as Invalid according to IE. I have tried converting the date to a moment object first and then into a valid date format but that has not seemed to work either.
I was able to conclude that IE does not like the .000Z at the end of the date. It works if I cut that off but that all my times are in GMT.