Class DateTextField

    • Constructor Detail

      • DateTextField

        public DateTextField​(String id,
                             IModel<Date> model,
                             DateConverter converter)
        Construct with a converter.
        Parameters:
        id - The component id
        model - The model
        converter - The converter to use
      • DateTextField

        public DateTextField​(String id,
                             DateConverter converter)
        Construct with a converter, and a null model.
        Parameters:
        id - The component id
        converter - The converter to use
    • Method Detail

      • forDatePattern

        public static DateTextField forDatePattern​(String id,
                                                   IModel<Date> model,
                                                   String datePattern)
        Creates a new DateTextField defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        model - The model
        datePattern - The pattern to use. Must be not null. See SimpleDateFormat for available patterns.
        Returns:
        DateTextField
      • forDatePattern

        public static DateTextField forDatePattern​(String id,
                                                   String datePattern)
        Creates a new DateTextField defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        datePattern - The pattern to use. Must be not null. See SimpleDateFormat for available patterns.
        Returns:
        DateTextField
      • forDateStyle

        public static DateTextField forDateStyle​(String id,
                                                 IModel<Date> model,
                                                 String dateStyle)
        Creates a new DateTextField using the provided date style.
        Parameters:
        id - The id of the text field
        model - The model
        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 DateTimeFormat.forStyle(String).
        Returns:
        DateTextField
      • forDateStyle

        public static DateTextField forDateStyle​(String id,
                                                 String dateStyle)
        Creates a new DateTextField using the provided date style.
        Parameters:
        id - The id of the text field
        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 DateTimeFormat.forStyle(String).
        Returns:
        DateTextField
      • forShortStyle

        public static DateTextField forShortStyle​(String id)
        Creates a new DateTextField defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        Returns:
        DateTextField
      • forShortStyle

        public static DateTextField forShortStyle​(String id,
                                                  IModel<Date> model,
                                                  boolean applyTimeZoneDifference)
        Creates a new DateTextField defaulting to using a short date pattern
        Parameters:
        id - The id of the text field
        model - The model
        applyTimeZoneDifference - Whether to apply the time zone difference between client and server
        Returns:
        DateTextField
      • withConverter

        public static DateTextField withConverter​(String id,
                                                  DateConverter converter)
        Creates a new DateTextField using the provided converter.
        Parameters:
        id - The id of the text field
        converter - the date converter
        Returns:
        DateTextField
      • withConverter

        public static DateTextField withConverter​(String id,
                                                  IModel<Date> model,
                                                  DateConverter converter)
        Creates a new DateTextField using the provided converter.
        Parameters:
        id - The id of the text field
        model - The model
        converter - the date converter
        Returns:
        DateTextField