-
Notifications
You must be signed in to change notification settings - Fork 197
Closed
Description
version: v4.0.2
when I run the following script:
var start = moment('10/11/2019', 'MM/DD/YYYY');
var end = moment('10/05/2019', 'MM/DD/YYYY');
Array.from(moment.range(start, end).by('day')).map(function(date) {
return date.format()
});I got the output like this
// [
// "2019-10-11T00:00:00-07:00",
// "2019-10-12T00:00:00-07:00",
// "2019-10-13T00:00:00-07:00",
// "2019-10-14T00:00:00-07:00",
// "2019-10-15T00:00:00-07:00",
// "2019-10-16T00:00:00-07:00",
// "2019-10-17T00:00:00-07:00"
// ]Apparently, the result is incorret, and what I expected should be [] or [endDate, ... , startDate]
I was wondering if there is any validation for the case that start date is later than the end date? otherwise, I need to validate it by myself before generate the range.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels