Hi,
I tried to write a general custom date and time-converter because I do not want to write the whole formatting information everytime in the tag like this:
<f:convertDateTime pattern="HH:mm" timeZone="Europe/Berlin"/>
public class CMTDateTimeConverter extends DateTimeConverter { public static final String CONVERTER_ID = "CMTDTConverter"; final public static String DATE_FORMAT = "dd-MMM-yyyy"; final public static String TIME_FORMAT = "HH:mm"; public CMTDateTimeConverter() { super(); //setLocale(getLocale()); setTimeZone(TimeZone.getTimeZone("Europe/Berlin")); setTimeStyle(DATE_FORMAT); setDateStyle(TIME_FORMAT); } }
<converter> <description>Timezone Europe/Berlin</description> <converter-id>CMTDTConverter</converter-id> <converter-class>de.cmt.helper.CMTDateTimeConverter</converter-class> </converter>
<h:outputText value="#{appointment.time}" > <f:convertDateTime converterId="CMTDTConverter"/> </h:outputText>