Skip to content

Commit

Permalink
Fixed #15576 - Table | filter: templating filter as Calendar with sel…
Browse files Browse the repository at this point in the history
…ectionMode range throws error
  • Loading branch information
mehmetcetin01140 committed May 17, 2024
1 parent b55baa8 commit c2e3e73
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2688,6 +2688,10 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {

toggleAMPMIfNotMinDate(newPM: boolean) {
let value = this.value;

if (this.selectionMode === 'range' && Array.isArray(value) && value.length > 0) {
value = value[value.length - 1];
}
const valueDateString = value ? value.toDateString() : null;
let isMinDate = this.minDate && valueDateString && this.minDate.toDateString() === valueDateString;
if (isMinDate && this.minDate.getHours() >= 12) {
Expand Down

0 comments on commit c2e3e73

Please sign in to comment.