小编m.r*_*ice的帖子

if语句的条件应该等于true,但它不是

 if (emptyGrid) {
        ranges.push({ start: new Date(IndividualBugetFigures.awardYears_Unformatted[elementIndex].Begin), end: new Date(IndividualBugetFigures.awardYears_Unformatted[elementIndex].End) })
    }
    else {
        for (var i = 1; i < thisGridData.length; i++) {
            //debugger;                
            if (i === 1 && new Date(thisGridData[i].childEffBegDate) > new Date(IndividualBugetFigures.awardYears_Unformatted[elementIndex].Begin)) {
                ranges.push({ start: new Date(IndividualBugetFigures.awardYears_Unformatted[elementIndex].Begin), end: new Date(moment(thisGridData[i].childEffBegDate).subtract(1, 'days').calendar()) });
            }
            else {
                if (i + 1 < thisGridData.length) {
                    //console.log('beginDate EndDate', new Date(thisGridData[i].childEffEndDate) + ' ' + new Date(thisGridData[i + 1].childEffBegDate));
                    console.log('in the and part', new Date(moment(thisGridData[i].childEffEndDate).add(1, 'days').calendar()) + ' ' + new Date(thisGridData[i …
Run Code Online (Sandbox Code Playgroud)

javascript arrays

0
推荐指数
1
解决办法
58
查看次数

标签 统计

arrays ×1

javascript ×1