You have two problems:
Passing a string to the Date constructor calls Date.parse , which is highly implementation dependent and differs between browsers even for the standardized part.
ISO 8601 ES5 UTC, ( ES6 , )
, , , . , , , :
function parseISODate(s) {
var b = s.split(/\D/);
var d = new Date();
d.setHours(0,0,0,0);
d.setFullYear(b[0], --b[1], b[2]);
return d.getFullYear() == b[0] && d.getDate() == b[2]? d : NaN;
}
ISO 8601 . (, 2014-02-29), NaN ( ES5). , 0005-10-26 26 0005 .
parseISODate('2014-05-26').getDay()
.
(.. , 0005 1905), , , , 1 99
function parseISODate(s) {
var b = s.split(/\D/);
return new Date(b[0], --b[1], b[2]);
}