public void init(ActionServlet servlet, ModuleConfig config) { DateConverter converterDate = new DateConverter(); converterDate.setPattern("E MMM dd HH:mm:ss z yyyy"); ConvertUtils.register(converterDate, Date.class); ConvertUtils.register(new NestedWidgetsConverter(), NestedWidgets.class); }
private static ConvertUtilsBean createConverUtils() { DateConverter dateConverter = new DateConverter(); dateConverter.setPattern("yyyy-MM-dd"); ConvertUtilsBean convertUtilsBean = new ConvertUtilsBean(); convertUtilsBean.register(dateConverter, java.util.Date.class); convertUtilsBean.register(dateConverter, Timestamp.class); convertUtilsBean.register(dateConverter, java.sql.Date.class); return convertUtilsBean; }
public CommonsLocalDateConverter(String dateFormatString) { dateConverter = new DateConverter(); dateConverter.setPattern(dateFormatString); }
static { DateConverter dateConverter = new DateConverter(); dateConverter.setPattern(Application.DATE_FORMAT); ConvertUtils.register(dateConverter, Date.class); }