Показать сообщение отдельно
  #9 (permalink)  
Старый 05.04.2021, 19:29
Аватар для рони
Профессор
Отправить личное сообщение для рони Посмотреть профиль Найти все сообщения от рони
 
Регистрация: 27.05.2010
Сообщений: 33,072

Сообщение от jurvrn
элементы которой отделяются запятыми,
запятые это короткая форма var, вместо запятой можно добавить var.
было
var Dlast = new Date(year,month+1,0).getDate(),
            D = new Date(year,month,Dlast),
            DNlast = D.getDay(),
            DNfirst = new Date(D.getFullYear(),D.getMonth(),1).getDay(),
            calendar = '<tr>',
            m = document.querySelector('#'+id+' option[value="' + D.getMonth() + '"]'),
            g = document.querySelector('#'+id+' input');


станет
Date.prototype.setTimezoneOffset = function(minutes) {
    var _minutes;
    if (this.timezoneOffset == _minutes) {
        _minutes = this.getTimezoneOffset();
    } else {
        _minutes = this.timezoneOffset;
    }
    if (arguments.length) {
        this.timezoneOffset = minutes;
    } else {
        this.timezoneOffset = minutes = this.getTimezoneOffset();
    }
    return this.setTime(this.getTime() + (_minutes - minutes) * 6e4);
};

var Dlast = new Date(year, month + 1, 0);
Dlast.setTimezoneOffset(-180);
Dlast = Dlast.getDate();
var D = new Date(year, month, Dlast);
D.setTimezoneOffset(-180);
var DNlast = D.getDay();
var DNfirst = new Date(D.getFullYear(), D.getMonth(), 1);
DNfirst.setTimezoneOffset(-180);
DNfirst = DNfirst.getDay();
var calendar = '<tr>',
    m = document.querySelector('#' + id + ' option[value="' + D.getMonth() + '"]'),
    g = document.querySelector('#' + id + ' input');
Ответить с цитированием