Skip to content

Commit

Permalink
fix(datepicker): quick ranges button is not selected with maxDate (#6670
Browse files Browse the repository at this point in the history
) (#6698)

Co-authored-by: Dmytro Danylov <daniloff200@gmail.com>
  • Loading branch information
lexasq and daniloff200 authored Oct 25, 2024
1 parent 604c3cb commit 1298c48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/datepicker/themes/bs/bs-custom-dates-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface BsCustomDates {
type="button"
class="btn"
(click)="selectFromRanges(range)"
[class.selected]="range.value === selectedRange">
[class.selected]="compareRanges(range)">
{{ range.label }}
</button>
</div>
Expand All @@ -32,4 +32,8 @@ export class BsCustomDatesViewComponent {
selectFromRanges(range?: BsCustomDates) {
this.onSelect.emit(range);
}

compareRanges(range?: BsCustomDates) {
return JSON.stringify(range?.value) === JSON.stringify(this.selectedRange);
}
}

0 comments on commit 1298c48

Please sign in to comment.