Skip to content

Commit

Permalink
Merge pull request #15600 from primefaces/issue-15576
Browse files Browse the repository at this point in the history
Fixed #15576 - Table | filter: templating filter as Calendar with sel…
  • Loading branch information
cetincakiroglu authored Jun 13, 2024
2 parents 6663685 + bc9bd54 commit 8f4762c
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 @@ -2702,6 +2702,10 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {

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

if ((this.selectionMode == 'range' || this.selectionMode == 'multiple') && 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 8f4762c

Please sign in to comment.