EWA DEMO emp-script emp-script-utils emp-script-static ffmpeg-utils weixin

[BUG] EWA_CalendarClass 当前日期为31号时,下一个月日历显示错误

2016-06-01

文件:EWA_07CalendarClass.js

类:EWA_CalendarClass

当前日期为31号时,下一个月日历显示错误,合成日历时选取当前年,月和当前日。当5月31日时,会出现下一个月变成6月31日,则会变成7月,因此出现错误。

涉及代码

function EWA_CalendarClass() {
    this.ChangeDate = function() {
        var y = this._SelectYear.value;
        var m = this._SelectMonth.value;
        // var d = this._DaysTable.getAttribute("EMP_CURRENT_DAY"); // 出错的地方
        
        this._SetNewDate(y, m, 1);
        this._SetNewDate();
        this._WriteDays(false);
    };
    this._SetNewDate = function(y, m, d) {
        if (!y) {
            var y = this._SelectYear.value;
            var m = this._SelectMonth.value;
            var d = this._DaysTable.getAttribute("EMP_CURRENT_DAY");
        }
        this._CurDate = new Date(y, m, d);
        if (this.IsShowTime) {
            var hh = this._SelectHour.value;
            var mm = this._SelectMinute.value;

            this._CurDate.setHours(hh);
            this._CurDate.setMinutes(mm);
        }
    };
    ....
}