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
)
  • Loading branch information
daniloff200 committed Oct 22, 2024
1 parent 4741422 commit fb95c59
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 fb95c59

Please sign in to comment.