Dependency on Date(string) constructor which does not have a standardized behaviour (i.e. spec on what formats are parsable).
yyyy-mm-dd is not (on a Mac). Perhaps yyyy-mm-dd fails someplace else but mm-dd-yyyy works ?
Something like: (from http://stackoverflow.com/questions/3085937/safari-js-cannot-parse-yyyy-mm-dd-date-format)
function parseDate(input, format) {
format = format || 'yyyy-mm-dd'; // default format
var parts = input.match(/(\d+)/g),
i = 0, fmt = {};
// extract date-part indexes from the format
format.replace(/(yyyy|dd|mm)/g, function(part) { fmt[part] = i++; });
return new Date(parts[fmt['yyyy']], parts[fmt['mm']]-1, parts[fmt['dd']]);
}
might work. Trying it now !