I am converting a simple dateString to Date object. The following code works perfectly on all browsers except Firefox.
var dateString = "02-24-2014 09:22:21 AM";
var dateObject = new Date(dateString);
console.log(dateObject.toDateString());
The Firebug console in Firefox says Invalid Date
. What am I doing wrong here?
I also tried replacing -
with \
, but it didnt help.
Is it possible to do this without using any libraries?