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

The datepicker should display the month of [minDate] by default when opened. #3123

Closed
JimJafar opened this issue Nov 28, 2017 · 3 comments · Fixed by #3129
Closed

The datepicker should display the month of [minDate] by default when opened. #3123

JimJafar opened this issue Nov 28, 2017 · 3 comments · Fixed by #3129
Assignees

Comments

@JimJafar
Copy link

Bug description or feature request:

When [minDate] is set dynamically (e.g. when bound to another datepicker's ngModel value) to a future date, opening the datepicker shows only greyed out dates and the user must navigate to the correct month before they can pick a date.

There is another problem here - when [minDate] is dynamically set to a date near the end of the year (e.g. December 30th 2017) it is not possible to navigate using the > button (selecting the month by name still works). This part of the bug is not reproducable in my plunkr - has it been fixed in the unpkg.com version?

Plunker/StackBlitz that reproduces the issue:

https://plnkr.co/edit/VPVQvEqu3bLwNxpsMbxx?p=preview

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 2.0.0-beta.9

Angular: 5.0.1

Bootstrap: bootstrap-sass 3.3.7

Build system: Angular CLI, System.js, webpack, starter seed:

webpack

@valorkin
Copy link
Member

similar to #2711

@valorkin
Copy link
Member

to sum up:

  • if view date is provided (bsValue|ngModel) it should be shown
  • if view date is not provider:
    • if minDate>currentDate (default view value), show minDate
    • if maxDate<currentDate(default view value) show maxDate

valorkin added a commit that referenced this issue Nov 28, 2017
if no date is selected and min or max dates are excluding current month
show minimal or maximal provided date

fixes #3123 fixes #2711
@ghost ghost assigned valorkin Nov 28, 2017
@ghost ghost added the in progress label Nov 28, 2017
valorkin added a commit that referenced this issue Nov 28, 2017
if no date is selected and min or max dates are excluding current month
show minimal or maximal provided date

fixes #3123 fixes #2711
valorkin added a commit that referenced this issue Nov 28, 2017
if no date is selected and min or max dates are excluding current month
show minimal or maximal provided date

fixes #3123 fixes #2711
valorkin added a commit that referenced this issue Nov 28, 2017
if no date is selected and min or max dates are excluding current month
show minimal or maximal provided date

fixes #3123 fixes #2711
@ghost ghost removed the in progress label Nov 28, 2017
@JimJafar
Copy link
Author

Thanks @valorkin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants