In my AngularJs application, I am getting the date in string format which I need to convert to datetime and show in a datepicker. It’s working in Chrome but in Firefox converting string to datetime is showing “Invalid Date” error. I have used below code
There are also libraries like moment.js that will (if I remember correctly) allow some different formats. You could also write your own helper functions to accept/return whatever formats you want.
There is some discussion of valid date formats here.
Each browser choses how to implement JS. They all start with the basic specifications, but some may go a little beyond that and others a little behind, so you get things like you’ve discovered. It’s part of the “fun” of web development. When it doubt, check the docs.