Skip to content

Date range picker two calendar view display 4 buttons to change month instead of 2 #6581

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

Open
FarlasDTP opened this issue May 15, 2023 · 0 comments

Comments

@FarlasDTP
Copy link

Bug description:
In inline date range picker two calendar view all 4 button arrows to change month are visible when both min date and max date have same month.

StackBlitz: https://stackblitz.com/edit/angular-xfptm6?file=src/main.ts

Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 10.3.0
Angular: 15.2.9
Bootstrap: 5.2.3

Expected behavior

Only 2 arrows to change month to be visible, it should look the same as when you comment out min date or max date in config.

Additional info

This function seems to be a problem, but I don't know why it check for it because for me one month display does not depend on min/max date.

function isDisplayOneMonth(viewDate: Date, minDate?: Date, maxDate?: Date) {
  if (maxDate && isSame(maxDate, viewDate, 'day')) {
    return true;
  }

  return minDate && maxDate && minDate.getMonth() === maxDate.getMonth();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants