Skip to content

Commit

Permalink
fix- daterange picker, default range in quick Select ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekLiang committed Nov 1, 2024
1 parent f09e4b1 commit e357cde
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/datepicker/themes/bs/bs-custom-dates-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class BsCustomDatesViewComponent {
}

compareRanges(range?: BsCustomDates) {
const currentRange = range?.value;
if (Array.isArray(currentRange) && Array.isArray(this.selectedRange)) {
return new Date(currentRange[0]).setHours(0, 0, 0, 0) === new Date(this.selectedRange[0]).setHours(0, 0, 0, 0)
&& new Date(currentRange[1]).setHours(0, 0, 0, 0) === new Date(this.selectedRange[1]).setHours(0, 0, 0, 0);
}

return JSON.stringify(range?.value) === JSON.stringify(this.selectedRange);
}
}

0 comments on commit e357cde

Please sign in to comment.