diff --git a/src/datepicker/themes/bs/bs-custom-dates-view.component.ts b/src/datepicker/themes/bs/bs-custom-dates-view.component.ts index 9bc17f543b..533bb4a55b 100644 --- a/src/datepicker/themes/bs/bs-custom-dates-view.component.ts +++ b/src/datepicker/themes/bs/bs-custom-dates-view.component.ts @@ -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 }} @@ -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); + } }