p:datePicker default date set to current date not taking into account mindate #3494
-
I have a p:datePicker with a mindate two weeks from now. When I select an hour first, the text box displays the current date which is invalid according to my mindate. Reproduced with PrimeFaces 14.0.9 and PrimeFaces 15.0.0-RC2 |
Beta Was this translation helpful? Give feedback.
Answered by
BryceMcGilly
Jan 31, 2025
Replies: 1 comment 1 reply
-
@BryceMcGilly It sounds like a bug to me. can you paste your example HTML so I can try it. The DatePicker has this code to defend against that. if (viewDateDefaultsToNow) {
if (this.options.minDate) {
if (this.viewDate < this.options.minDate) {
this.viewDate = new Date(this.options.minDate.getTime());
}
}
if (this.options.maxDate) {
if (this.viewDate > this.options.maxDate) {
this.viewDate = new Date(this.options.maxDate.getTime());
}
}
} And if you can reproduce in a PF Test can you open a GitHub Issue please? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue created: primefaces/primefaces#13285
Reproducer: https://github.com/BryceMcGilly/primefaces-test
Example xhtml: