Class MonthPicker.MonthPickerI18n

java.lang.Object
org.vaadin.addons.componentfactory.monthpicker.MonthPicker.MonthPickerI18n
All Implemented Interfaces:
Serializable
Enclosing class:
MonthPicker

public static class MonthPicker.MonthPickerI18n extends Object implements Serializable
A class that contains internationalization settings for the MonthPicker component.

This allows customizing month names, labels, and parsing/formatting patterns for the value input field.

See Also:
  • Constructor Details

    • MonthPickerI18n

      public MonthPickerI18n()
  • Method Details

    • getMonthNames

      public List<String> getMonthNames()
      Gets the name of the months.
      Returns:
      the month names
    • setMonthNames

      public MonthPicker.MonthPickerI18n setMonthNames(List<String> monthNames)
      Sets the name of the months, starting from January and ending on December. These are used for parsing and formatting, when the long month name pattern ("MMMM") is used.
      Parameters:
      monthNames - the month names
      Returns:
      this instance for method chaining
    • getMonthLabels

      public List<String> getMonthLabels()
      Gets the labels of the months.
      Returns:
      the month labels
    • setMonthLabels

      public MonthPicker.MonthPickerI18n setMonthLabels(List<String> monthLabels)
      Sets the labels of the months, to be shown in the calendar overlay.
      Parameters:
      monthLabels - the month labels
      Returns:
      this instance for method chaining
    • getShortMonthNames

      public List<String> getShortMonthNames()
      Gets the short labels of the months.
      Returns:
      the short month labels
    • setShortMonthNames

      public MonthPicker.MonthPickerI18n setShortMonthNames(List<String> shortMonthNames)
      Sets the short names of the months. These are used for parsing and formatting, when the short month name pattern ("MMM") is used.
      Parameters:
      shortMonthNames - the short month names
      Returns:
      this instance for method chaining
    • getFormats

      public List<String> getFormats()
      Get the list of custom formats that are used for formatting the year-month displayed in the text field, and for parsing the user input
      Returns:
      list of date patterns or null
    • setFormat

      public MonthPicker.MonthPickerI18n setFormat(String format)
      Sets a single format pattern to be used for both displaying and parsing values.

      • YY - 2-digit year
      • YYYY - 4-digit year
      • M - 1- or 2-digit month
      • MM - 2-digit month (with leading zero)
      • MMM - short month name (requires the i18n short month names to be set)
      • MMMM - long month name (requires the i18n month names to be set)
      Parameters:
      format - a string pattern using year-month symbols (e.g., "MM-YYYY")
      Returns:
      this instance for method chaining
      See Also:
    • setFormats

      public MonthPicker.MonthPickerI18n setFormats(String primaryFormat, String... additionalParsingFormats)
      Sets a primary format and additional parsing formats for interpreting user input.

      The primary format is used for both formatting and parsing. If parsing fails using the primary format, additional formats are used in order.

      Format patterns may include:

      • YY - 2-digit year
      • YYYY - 4-digit year
      • M - 1- or 2-digit month
      • MM - 2-digit month (with leading zero)
      • MMM - short month name (requires the i18n short month names to be set)
      • MMMM - long month name (requires the i18n month names to be set)

      Parameters:
      primaryFormat - the main format used for formatting and parsing
      additionalParsingFormats - fallback formats used for parsing only
      Returns:
      this instance for method chaining