Module javafx.base

Class DateTimeStringConverter

    • Field Detail

      • locale

        protected final Locale locale
      • pattern

        protected final String pattern
      • dateFormat

        protected final DateFormat dateFormat
      • dateStyle

        protected final int dateStyle
        Since:
        JavaFX 8u40
      • timeStyle

        protected final int timeStyle
        Since:
        JavaFX 8u40
    • Constructor Detail

      • DateTimeStringConverter

        public DateTimeStringConverter​(int dateStyle,
                                       int timeStyle)
        Create a StringConverter for Date values, using specified DateFormat styles for date and time.
        Parameters:
        dateStyle - the given formatting style. For example, DateFormat.SHORT for "M/d/yy" in the US locale.
        timeStyle - the given formatting style. For example, DateFormat.SHORT for "h:mm a" in the US locale.
        Since:
        JavaFX 8u40
      • DateTimeStringConverter

        public DateTimeStringConverter​(Locale locale)
        Create a StringConverter for Date values, using the specified locale and DateFormat.DEFAULT styles for date and time.
        Parameters:
        locale - the given locale.
      • DateTimeStringConverter

        public DateTimeStringConverter​(Locale locale,
                                       int dateStyle,
                                       int timeStyle)
        Create a StringConverter for Date values, using specified locale and DateFormat styles for date and time.
        Parameters:
        locale - the given locale.
        dateStyle - the given formatting style. For example, DateFormat.SHORT for "M/d/yy" in the US locale.
        timeStyle - the given formatting style. For example, DateFormat.SHORT for "h:mm a" in the US locale.
        Since:
        JavaFX 8u40
      • DateTimeStringConverter

        public DateTimeStringConverter​(String pattern)
        Create a StringConverter for Date values, using the specified pattern.
        Parameters:
        pattern - the pattern describing the date and time format.
      • DateTimeStringConverter

        public DateTimeStringConverter​(Locale locale,
                                       String pattern)
        Create a StringConverter for Date values, using the specified locale and pattern.
        Parameters:
        locale - the given locale.
        pattern - the pattern describing the date and time format.
      • DateTimeStringConverter

        public DateTimeStringConverter​(DateFormat dateFormat)
        Create a StringConverter for Date values, using the specified DateFormat formatter.
        Parameters:
        dateFormat - the DateFormat to be used for formatting and parsing.
    • Method Detail

      • getDateFormat

        protected DateFormat getDateFormat()

        Return a DateFormat instance to use for formatting and parsing in this StringConverter.

        Returns:
        a DateFormat instance for formatting and parsing in this StringConverter