I have an element that shows a date string in this format:
<div> ListDate: 2014-11-22 00:00:00.0 </div>
I have a variable that captures that text, now I am stripping out all but the date string and trying to convert it to a date so I can do some math on it. My code works fine in Chrome, but always returns NaN in FF and Safari. Here is the javascript:
var listDate = " ListDate: 2014-11-22 00:00:00.0 ";
listDate = listDate.replace('ListDate:', '');
listDate = $.trim(listDate);
listDate = Date.parse(listDate);
I'm watching it in Firebug, and it performs as expected up until Date.parse(). I tried the solutions shown on this thread, but still no luck. Any ideas? I don't have control over the html, it comes from a web service.