Skip to content

Commit

Permalink
Merge pull request #15489 from RogueTea/calendar-keepinvalid
Browse files Browse the repository at this point in the history
Fixes #15487 - Calendar component: invalid date value is removed even though KeepInvalid is true
  • Loading branch information
cetincakiroglu authored May 8, 2024
2 parents 7cdc42e + 563b07d commit 94d43bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3427,6 +3427,9 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
}

isValidDateForTimeConstraints(selectedDate: Date) {
if (this.keepInvalid) {
return true; // If we are keeping invalid dates, we don't need to check for time constraints
}
return (!this.minDate || selectedDate >= this.minDate) && (!this.maxDate || selectedDate <= this.maxDate);
}

Expand Down

0 comments on commit 94d43bb

Please sign in to comment.