-
Notifications
You must be signed in to change notification settings - Fork 439
Open
Description
Context
Initialization of intervalEnd is incorrect with more than one month visible. Returns the end day of the first month, not the end day of the last month.
There is no way to get the start date of the first month and the end of the last month before clicking the next or previous button
Expected Behavior
The last day of the last month, the same as if you click on next or previous
Actual Behavior
Returns the end day of the first month
Possible Fix
I think the wrong code is this, delete it?
if (this.options.startWithMonth) {
this.month = moment(this.options.startWithMonth).startOf('month');
this.intervalStart = moment(this.month);
this.intervalEnd = this.options.lengthOfTime.days
? moment(this.month)
.add(this.options.lengthOfTime.days - 1, 'days')
.endOf('day')
: moment(this.month).endOf('month');
}
Steps to Reproduce
- Initialize the calendar with 3 monts and startWithMonth
- Get this.intervalEnd in ready callback
Your Environment
- Version used: 1.5.1
- Browser Name and version:
- Operating System and version (desktop or mobile):
- Link to your project:
Metadata
Metadata
Assignees
Labels
No labels