diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bdeb4c8c09..2a879e74d6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,8 +2,9 @@ "recommendations": [ "nrwl.angular-console", "angular.ng-template", + "EditorConfig.EditorConfig", "ms-vscode.vscode-typescript-tslint-plugin", "esbenp.prettier-vscode", "firsttris.vscode-jest-runner" ] -} \ No newline at end of file +} 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); + } }