super(id, model, metaData, viewOnly);
type = metaData.getPropertyType();
boolean displayTz = false;
Component metaDataComponent = metaData.getBeanMetaData().getComponent();
Localizer localizer = metaDataComponent.getLocalizer();
if (Time.class.isAssignableFrom(type) ||
java.sql.Date.class.isAssignableFrom(type) ||
Date.class.isAssignableFrom(type) ||
Timestamp.class.isAssignableFrom(type)) {
fmt = localizer.getString(DATE_TIME_FIELD_PREFIX + "date" + FORMAT_SUFFIX, metaDataComponent, DATE_FMT_STR);
}
else if (Calendar.class.isAssignableFrom(type)) {
fmt = viewOnly ? localizer.getString(DATE_TIME_FIELD_PREFIX + "datetz" + FORMAT_SUFFIX, metaDataComponent, DATE_ZONE_FMT_STR) :
localizer.getString(DATE_TIME_FIELD_PREFIX + "date" + FORMAT_SUFFIX, metaDataComponent, DATE_FMT_STR);
displayTz = true;
}
else {
throw new RuntimeException("YUIDateField does not handle " + type);
}