Open razzp opened 4 years ago
Same thing is happening when using by "day" it is excluding the last day.
same question
I removed the module because of this issue. The following works fine:
private getDateRange(from: Moment, to: Moment): readonly Moment[] {
const numberOfDays = to.diff(from, 'days') + 1;
return [...Array(numberOfDays).keys()].map(i => moment(from).add(i, 'days'));
}
I have a date range that starts in June and runs through July and into August. Creating an iterable of months in the range yields only the first two months. August is not included.
Steps to Reproduce
Expected Behavior
Array [ "June", "July", "August" ]
Current Behavior
Array [ "June", "July" ]
moment.js 2.27.0 moment-range 4.0.2
Unless I'm missing something this seems to be a bug. Explicitly setting
{ excludeEnd: false }
doesn't work either.