Comparing dates in jquery

前端 未结 7 1679
鱼传尺愫
鱼传尺愫 2020-12-10 04:08

I am having the following codes and it though i\'m having 01-Jan-2009 for DateTo and 03-Jan-2009 for DateFrom it\'s readi

7条回答
  •  无人及你
    2020-12-10 04:37

    you can use below code to parse through the dates, using the millisecond approach (adding milliseconds present in a day) will not work properly for the daylightsaving.

    for ( beginDate= new Date(startDate.getTime()); beginDate.getTime()<=endDate.getTime(); beginDate.setDate(beginDate.getDate() + 1)) {
                dateRangeArray.push(new Date(beginDate.getTime()));
            }
    

提交回复
热议问题