You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>start.toString()'Tue Dec 14 2021 08:57:13 GMT-0300 (Argentina Standard Time)'
end
>end.toString()'Fri Dec 17 2021 07:58:05 GMT-0300 (Argentina Standard Time)'
If I want to create a range, I get this:
So the range seems right, I have the range from Tue Dec 14 2021 to Fri Dec 17 2021
Ok, so I want an array of all the dates including the start, the end and the dates in between.
Using the .by operator, I'm getting only 3 dates, the last date is not being included there:
More visible here:
>moment.range(moment(start),moment(end)).contains(moment(end))true>Array.from(moment.range(moment(start),moment(end)).by('day')).map(x=>x.format('MM-DD-YYYY'))(3)['12-14-2021','12-15-2021','12-16-2021']// with excludeEnd: false>Array.from(moment.range(moment(start),moment(end)).by('day',{excludeEnd: false})).map(x=>x.format('MM-DD-YYYY'))(3)['12-14-2021','12-15-2021','12-16-2021']// with excludeEnd: true>Array.from(moment.range(moment(start),moment(end)).by('day',{excludeEnd: true})).map(x=>x.format('MM-DD-YYYY'))(2)['12-14-2021','12-15-2021']
To Reproduce
Steps to reproduce the behavior above.
I have two dates
start
end
If I want to create a range, I get this:
So the range seems right, I have the range from Tue Dec 14 2021 to Fri Dec 17 2021
Ok, so I want an array of all the dates including the start, the end and the dates in between.
Using the
.by
operator, I'm getting only 3 dates, the last date is not being included there:More visible here:
To Reproduce
Steps to reproduce the behavior above.
Expected behavior
I need to get the 4 dates
Screenshots
above
Desktop (please complete the following information):
Moment-specific environment
GMT-0300 (Argentina Standard Time)
03/03/2022
Typescript and Flow
Please run the following code in your environment and include the output:
in
package.json
Additional context
I'm running the code in vscode version 1.64.2
The text was updated successfully, but these errors were encountered: