JSFiddle - React, Tailwind, and code Playground

by Alexander

HTML

<h1>Костыль для Firefox, исправляющий ошибки с таймзонами на 2015 год (пока не выйдет 35 версия)</h1>

JavaScript

console.clear();

var bind   = Function.bind,
    unbind = bind.bind(bind);

function instantiate(constr, args) {
    return new (unbind(constr, null).apply(null, args));
}

Date = function (Date) {
    var _Date = Date;

    return function () {
        var strToDate,
            args = arguments;

        if (arguments.length === 1) {
            args[0] = args[0].replace(/\//g,"-");
        }
        
        if (arguments.length === 3) {            
            strToDate = arguments[0] + '-0' + (arguments[1] + 1) + '-0' + arguments[2]
            return instantiate(Date, [strToDate]);
        }

        return instantiate(Date, args);
    }
}(Date);


console.log(new Date(2015,0,7));
console.log(new Date("2015/01/07"));
console.log(new Date("2015-01-07"));