/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id, IModel<Date> model) { return new DateLabel(id, model, new StyleDateConverter(true)); }
/** * @return formatter The formatter for the current conversion */ @Override protected DateTimeFormatter getFormat(Locale locale) { return DateTimeFormat.forPattern(getDatePattern(locale)) .withLocale(locale) .withPivotYear(2000); } }
/** * @return formatter The formatter for the current conversion */ @Override protected DateTimeFormatter getFormat(Locale locale) { return DateTimeFormat.forPattern(getDatePattern(locale)) .withLocale(locale) .withPivotYear(2000); } }
/** * Creates a new DateTextField defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param applyTimeZoneDifference * Whether to apply the time zone difference between client and server * @return DateTextField */ public static DateTextField forShortStyle(String id, IModel<Date> model, boolean applyTimeZoneDifference) { return new DateTextField(id, model, new StyleDateConverter(applyTimeZoneDifference)); }
/** * Creates a new DateTextField defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param applyTimeZoneDifference * Whether to apply the time zone difference between client and server * @return DateTextField */ public static DateTextField forShortStyle(String id, IModel<Date> model, boolean applyTimeZoneDifference) { return new DateTextField(id, model, new StyleDateConverter(applyTimeZoneDifference)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forShortStyle(String id, IModel<Date> model) { return new DateLabel(id, model, new StyleDateConverter(true)); }
/** * Creates a new DateTextField using the provided date style. * * @param id * The id of the text field * @param model * The model * @param dateStyle * Date style to use. The first character is the date style, and the second character * is the time style. Specify a character of 'S' for short style, 'M' for medium, 'L' * for long, and 'F' for full. A date or time may be ommitted by specifying a style * character '-'. See {@link DateTimeFormat#forStyle(String)}. * @return DateTextField */ public static DateTextField forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateTextField(id, model, new StyleDateConverter(dateStyle, true)); }
/** * Creates a new DateTextField using the provided date style. * * @param id * The id of the text field * @param model * The model * @param dateStyle * Date style to use. The first character is the date style, and the second character * is the time style. Specify a character of 'S' for short style, 'M' for medium, 'L' * for long, and 'F' for full. A date or time may be ommitted by specifying a style * character '-'. See {@link DateTimeFormat#forStyle(String)}. * @return DateTextField */ public static DateTextField forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateTextField(id, model, new StyleDateConverter(dateStyle, true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateLabel(id, model, new StyleDateConverter(dateStyle, true)); }
/** * Creates a new DateLabel defaulting to using a short date pattern * * @param id * The id of the text field * @param model * The model * @param dateStyle * style to use in case no pattern is provided. Must be two characters from the set * {"S", "M", "L", "F", "-"}. Must be not null. See * {@link DateTimeFormat#forStyle(String)} for options. * @return new instance * * @see org.apache.wicket.markup.html.form.TextField */ public static DateLabel forDateStyle(String id, IModel<Date> model, String dateStyle) { return new DateLabel(id, model, new StyleDateConverter(dateStyle, true)); }
public View(String id, Node dateNode, IModel<Date> valueModel) throws RepositoryException { super(id, "view", DatePickerPlugin.this); add(new DateLabel("label", valueModel, new StyleDateConverter(true))); String weekOfYear = dateNode.hasProperty(HIPPOSTD_WEEKOFYEAR) ? dateNode.getProperty(HIPPOSTD_WEEKOFYEAR).getString() : "-"; add(new Label("weekofyear", weekOfYear)); if (dateNode.hasProperty(HIPPOSTD_DAYOFWEEK)) { add(new Label("dayofweek", new TypeTranslator(new JcrNodeTypeModel(HIPPOSTD_DATE)).getValueName( HIPPOSTD_DAYOFWEEK, new Model<String>(dateNode.getProperty(HIPPOSTD_DAYOFWEEK).getString())))); } else { add(new Label("dayofweek", "-")); } String dayOfYear = dateNode.hasProperty(HIPPOSTD_DAYOFYEAR) ? dateNode.getProperty(HIPPOSTD_DAYOFYEAR).getString() : "-"; add(new Label("dayofyear", dayOfYear)); } }
new StyleDateConverter("S-", true))
new StyleDateConverter("S-", true))