// for convenience, we will set the time zone of the converter to that
// specified by the context or, if that is not present, to the time zone
// of the server
if (converter instanceof DateTimeConverter)
{
DateTimeConverter dtc = (DateTimeConverter) converter;
boolean trinidadDTC = _isTrinidadDateTimeConverter(converter);
if (!trinidadDTC)
{
// if it is not the Trinidad DateTimeConverter, set the date style to
// short
dtc.setDateStyle("short");
}
// if it is not the Trinidad DateTimeConverter or (it is AND
// no time zone is set) then we want to set the
// time zone to the one in the faces context or use
// the default server time zone on the converter
if (!trinidadDTC || dtc.getTimeZone() == null)
{
TimeZone tz = null;
RequestContext requestContext = RequestContext.getCurrentInstance();
tz = requestContext.getTimeZone();
if(tz == null)
{
tz = TimeZone.getDefault();
}
dtc.setTimeZone(tz);
}
}
return converter;
}