0

I need to add +1 day in mindate (or) I don't want to accept the condition as in the image, effective date and expiration date as same. enter image description here

Here is the code:

<p:calendar id="Jurisdiction_Expiration_Date"
            styleClass="calender_style" pattern="MM/dd/yyyy"
            required="true" size="10" readonlyInput="true" showOn="both"
            mindate="#{ApplicationManagedBean23.saveRequestMap['JurisdictionEffectiveDate']}">
Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
New User
  • 29
  • 5

1 Answers1

0

Couple of things here:

  1. p:calendar is deprecated. Please use p:datePicker.
  2. Use value-binding as demonstrated in the basic example: https://www.primefaces.org/showcase/ui/input/datepicker/datePickerJava8.xhtml
  3. Use a modern Java 8 date (only) type like LocalDate which makes it easy to add a day: localDate.plusDays(1).
  4. Add an Ajax listener where you set the min date based on the changed value and update the component with the min date (which you bind to the bean property).
  5. Make sure you are using the correct bean scope.

See also:

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102