Datepicker dateonly mode when value is localdatetime
Posted: 07 Apr 2021, 16:17
If I have a schedule with events and these events have begin and end properties which are LocalDateTimes, it would be nice if I have an all day property for an event to not show the time input of the datepicker component. I believe this is possible with p:calendar. This could be done using pattern, but if I have a datepicker with pattern="MM/dd/yyyy" the time input is still displayed if the value is a localdatetime. It seems that the only way currently to not display the time input is to use a localdate.
Thanks.
Code: Select all
<p:datePicker pattern="MM/dd/yyyy" value="#{backingbean.somelocaldatetime}"/>
<p:datePicker dateOnly="#{backingbean.event.allDay}" value="#{backingbean.somelocaldatetime}"/>