Or the last time the slide bar problem, suddenly found in Firefox and IE on the scale and time did not show (I developed the use of Google, then did not go to test), so began to add a breakpoint in so many lines of code debugging, finally found new date (strdate), the return is invalid time format, I was depressed ~~~~~ so I went to see the API read the description of the date, in the inside to find other construction methods to try, it is true kung Fu Ah!!!! Finally can be relieved of work!!!! The code is as follows:
/** * Fix IE, Firefox is incompatible with new date (s) * @param strdate * Return Date Object * Add by ZYF at November 5, 2015 */function getdateforstringdate (ST Rdate) {//cutting date and time division is called array var s = strdate.split (""); var S1 = s[0].split ("-"); var s2 = s[1].split (":"), if (s2.length==2) {S2.push ("00");} return new Date (s1[0],s1[1]-1,s1[2],s2[0],s2[1],s2[2]);}
The other constructor is also compatible with the more strong to stick it out
var date = new Date (Strdate.replace ("-", "/"). Replace ("-", "/"));
OK, dinner went to ~~~~~.
JS uses new date (str) To create time objects incompatible with Firefox and IE solutions