-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DateRangePicker: Quick Select Ranges looses highlighting when used with maxDate
#6670
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
Comments
daniloff200
added a commit
to daniloff200/ngx-bootstrap
that referenced
this issue
Oct 21, 2024
daniloff200
added a commit
to daniloff200/ngx-bootstrap
that referenced
this issue
Oct 22, 2024
daniloff200
added a commit
to daniloff200/ngx-bootstrap
that referenced
this issue
Oct 22, 2024
daniloff200
added a commit
to daniloff200/ngx-bootstrap
that referenced
this issue
Oct 22, 2024
5 tasks
lexasq
added a commit
that referenced
this issue
Oct 25, 2024
) (#6698) Co-authored-by: Dmytro Danylov <daniloff200@gmail.com>
lexasq
pushed a commit
that referenced
this issue
Oct 28, 2024
lexasq
added a commit
that referenced
this issue
Oct 28, 2024
* fix(datepicker): fixed infinite cycle behavior * fix(modal): fix for issue-6683 body is scrollable if you close just one modal * fix(modal): fix for issue-6683 body is scrollable if you close just one modal * fix(modal): issue-6675 animation and issue-6547 * fix(modal): nested modals backdrop added * 18.1.3 * chore(versions): version bump * fix(datepicker): quick ranges button is not selected with maxDate (#6670) (#6698) Co-authored-by: Dmytro Danylov <daniloff200@gmail.com> * fix(docs): fixed typo in import --------- Co-authored-by: Dmytro Danylov <daniloff200@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug description:
Using
maxDate
option causesbs-custom-date-view
not highlighting selected quick range option, even if it's withing minDate-maxDate.Working OK (highlighting selected option):
Not working (not highlighting):
I suspect the problem is in these lines:
[1]
ngx-bootstrap/src/datepicker/themes/bs/bs-custom-dates-view.component.ts
Line 16 in d210ca6
[2]
ngx-bootstrap/src/datepicker/utils/bs-calendar-utils.ts
Line 107 in d210ca6
We are comparing by reference in [1], which by default works ok. But with
maxDate
provided, we are creating new array in [2] - which breaks the comparision in the template.Plunker/StackBlitz that reproduces the issue: https://stackblitz.com/edit/clkau7-grqzf4?file=src%2Fapp%2Fapp.component.html
Versions of ngx-bootstrap, Angular, and Bootstrap:
ngx-bootstrap: 12.0.0, 18.0.2
Angular: 17.1.3
Build system: Angular CLI, System.js, webpack, starter seed: Angular CLI
Expected behavior
Selected option to be highlighted, no matter if it was adjusted to match
maxDate
or not.The text was updated successfully, but these errors were encountered: