public static String getValueAsString(FacesContext context, UICalendar calendar, Object value, String pattern) {
        return getValueAsString(context, calendar, value, pattern, false);
    }
Try to convert the given value to an {@link Instant} or return <code>null</code> if there is no appropriate converter for doing so.
The type of the value must be one of {@link LocalDateTime}, {@link LocalDate}, {@link LocalTime}, {@link Date} (deprecated),
or a parsable date or time {@link String}. For any other this method throws a {@link FacesException}.
@param context the faces context
@param calendar the calendar component
@param value the value to convert
@param attributeName the attribute name of the value (e.g. mindate, or maxdate)
@return the {@link Instant} object or <code>null</code>
@throws FacesException if value type is not supported
primefaces/src/main/java/org/primefaces/util/CalendarUtils.java