Enum Class DateTimePartStyle

java.lang.Object
java.lang.Enum<DateTimePartStyle>
com.flowingcode.vaadin.addons.relativetime.DateTimePartStyle
All Implemented Interfaces:
Serializable, Comparable<DateTimePartStyle>, Constable

public enum DateTimePartStyle extends Enum<DateTimePartStyle>
Values for the Intl.DateTimeFormat date-part attributes (year, month, day, hour, minute, second, weekday). Not every part accepts every value; each setter on RelativeTime documents its valid subset.

Only relevant when Format.DATETIME is in effect.

  • Enum Constant Details

    • NUMERIC

      public static final DateTimePartStyle NUMERIC
      Numeric ("1", "2", "12"). Accepted by year, month, day, hour, minute, second.
    • TWO_DIGIT

      public static final DateTimePartStyle TWO_DIGIT
      Two-digit, zero-padded ("01", "12"). Accepted by year, month, day, hour, minute, second.
    • NARROW

      public static final DateTimePartStyle NARROW
      Narrow ("M", "T"). Accepted by month and weekday.
    • SHORT

      public static final DateTimePartStyle SHORT
      Short ("Mon", "Tue"). Accepted by month and weekday.
    • LONG

      public static final DateTimePartStyle LONG
      Long ("Monday", "Tuesday"). Accepted by month and weekday.
  • Method Details

    • values

      public static DateTimePartStyle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DateTimePartStyle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null