Open DheerajKN opened 5 years ago
There is a while Bug I am iterating with weeks between 2 dates and here is the code that I used
var itr = moment.twix(new Date('2018-10-06T00:00:00'),new Date('2018-11-12T00:00:00')).iterate("weeks"); var range=[]; while(itr.hasNext()){ range.push(itr.next().format("YYYY-M-D")) } console.log(range);
Which generates the below result:
"2018-9-30" "2018-10-7" "2018-10-14" "2018-10-21" "2018-10-28" "2018-11-4" "2018-11-11"
When I was requesting for week sequence starting from '6th October' why I am getting results from a week prior.
Expected Result:
"2018-10-6" "2018-10-12" "2018-10-19" "2018-10-26" "2018-11-1" "2018-11-8"
How can I resolve this issue??
moment(start).twix(end).toArray("week")
There is a while Bug I am iterating with weeks between 2 dates and here is the code that I used
Which generates the below result:
When I was requesting for week sequence starting from '6th October' why I am getting results from a week prior.
Expected Result:
How can I resolve this issue??