AndrewPoyntz / time-ago-pipe

An Angular pipe for converting a date string into a time ago
MIT License
130 stars 67 forks source link

Not working in IE 11 #18

Open rashmi-kumari-udaan opened 6 years ago

rashmi-kumari-udaan commented 6 years ago

its not working in IE 11

AndrewPoyntz commented 6 years ago

any more details? example / error log etc?

Chrisw32 commented 6 years ago

I had a similar experience, pipe worked in chrome but not IE, turns out the inputted date was invalid in IE but chrome managed to parse it: E.G In Chrome, this works: console.log(new Date("2018-09-11T07:12:55z")); Output: Tue Sep 11 2018 17:12:55 GMT+1000 (Australian Eastern Standard Time)

In IE, it fails as an invalid date: console.log(new Date("2018-09-11T07:12:55z")); Output: "[date] Invalid Date[date] Invalid Date"

Changing it to a valid ISO8601 formatted date (which Z needs to be uppercase) allows IE to parse the date, resulting in the pipe working again.