Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization intervalEnd error with more than one month #371

Open
rdavid2 opened this issue Jan 12, 2024 · 0 comments
Open

Initialization intervalEnd error with more than one month #371

rdavid2 opened this issue Jan 12, 2024 · 0 comments

Comments

@rdavid2
Copy link

rdavid2 commented Jan 12, 2024

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

  1. Initialize the calendar with 3 monts and startWithMonth
  2. 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:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant