1

I just tested my app today with my FireFox browser after using Chrome all along, and I noticed my app is not working correctly.

I've done some searching and I found that the following expression recognized has "Invalid date" in FF/IE, and works in chrome:

this.future = new Date(this.travelData.created_at);

when console logging this.future, I get Invalid Date message.

While console logging this.future in Chroms returns:

Mon May 23 2016 19:56:48 GMT+0300

So I wonder, how I can make it work in FF and other browsers too, while this.travelData.created_at returns the following format from my API:

2016-05-23 19:47:07

Hope someone knows a solution to this browser strange error, Thank you!

TheUnreal
  • 21,504
  • 41
  • 145
  • 251

1 Answers1

0

I guess you would need to convert this.travelData.created_at to a valid date first.

See also new Date() is working in Chrome but not Firefox and new Date() works differently in Chrome and Firefox

Community
  • 1
  • 1
Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506