public static class DatePicker.DatePickerI18n extends Object implements Serializable
DatePicker
.Constructor and Description |
---|
DatePickerI18n() |
Modifier and Type | Method and Description |
---|---|
String |
getCalendar()
Gets the translated word for
calendar . |
String |
getCancel()
Gets the translated word for
cancel . |
String |
getClear()
Gets the translated word for
clear . |
List<String> |
getDateFormats()
Get the list of custom date formats that are used for formatting the
date displayed in the text field, and for parsing the user input
|
int |
getFirstDayOfWeek()
Gets the first day of the week.
|
List<String> |
getMonthNames()
Gets the name of the months.
|
LocalDate |
getReferenceDate()
Gets the
referenceDate . |
String |
getToday()
Gets the translated word for
today . |
String |
getWeek()
Gets the translated word for
week . |
List<String> |
getWeekdays()
Gets the name of the week days.
|
List<String> |
getWeekdaysShort()
Gets the short names of the week days.
|
DatePicker.DatePickerI18n |
setCalendar(String calendar)
Sets the translated word for
calendar . |
DatePicker.DatePickerI18n |
setCancel(String cancel)
Sets the translated word for
cancel . |
DatePicker.DatePickerI18n |
setClear(String clear)
Sets the translated word for
clear . |
DatePicker.DatePickerI18n |
setDateFormat(String dateFormat)
Sets a custom date format to be used by the date picker.
|
DatePicker.DatePickerI18n |
setDateFormats(String primaryFormat,
String... additionalParsingFormats)
Sets custom date formats to be used by the date picker.
|
DatePicker.DatePickerI18n |
setFirstDayOfWeek(int firstDayOfWeek)
Sets the first day of the week.
|
DatePicker.DatePickerI18n |
setMonthNames(List<String> monthNames)
Sets the name of the months, starting from January and ending on
December.
|
DatePicker.DatePickerI18n |
setReferenceDate(LocalDate referenceDate)
Sets the
referenceDate . |
DatePicker.DatePickerI18n |
setToday(String today)
Sets the translated word for
today . |
DatePicker.DatePickerI18n |
setWeek(String week)
Sets the translated word for
week . |
DatePicker.DatePickerI18n |
setWeekdays(List<String> weekdays)
Sets the name of the week days, starting from
Sunday and
ending on Saturday . |
DatePicker.DatePickerI18n |
setWeekdaysShort(List<String> weekdaysShort)
Sets the short names of the week days, starting from
sun and
ending on sat . |
public List<String> getMonthNames()
public DatePicker.DatePickerI18n setMonthNames(List<String> monthNames)
monthNames
- the month namespublic List<String> getWeekdays()
public DatePicker.DatePickerI18n setWeekdays(List<String> weekdays)
Sunday
and
ending on Saturday
.weekdays
- the week days namespublic List<String> getWeekdaysShort()
public DatePicker.DatePickerI18n setWeekdaysShort(List<String> weekdaysShort)
sun
and
ending on sat
.weekdaysShort
- the short names of the week dayspublic List<String> getDateFormats()
public DatePicker.DatePickerI18n setDateFormat(String dateFormat)
The format is a string pattern using specific symbols to specify how and where the day, month and year should be displayed. The following symbols can be used in the pattern:
yy
- 2 digit year
yyyy
- 4 digit year
M
- Month, as 1 or 2 digits
MM
- Month, padded to 2 digits
d
- Day-of-month, as 1 or 2 digits
dd
- Day-of-month, padded to 2 digits
For example dd/MM/yyyy
, will format the 20th of June 2021 as
20/06/2021
.
Using a custom date format overrides the locale set in the date picker.
Setting the format to null will revert the date picker to use the locale for formatting and parsing dates.
dateFormat
- A string with a date format pattern, or null to remove the
previous custom formatpublic DatePicker.DatePickerI18n setDateFormats(String primaryFormat, String... additionalParsingFormats)
See setDateFormat(String)
on how date patterns
are structured.
Using custom date formats overrides the locale set in the date picker.
Setting the primary format to null will revert the date picker to use the locale for formatting and parsing dates.
primaryFormat
- A string with a date format pattern, or null to remove the
previous custom formatadditionalParsingFormats
- Additional date format patterns to be used for parsingpublic int getFirstDayOfWeek()
0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, 4 for Thursday, 5 for Friday, 6 for Saturday.
public DatePicker.DatePickerI18n setFirstDayOfWeek(int firstDayOfWeek)
0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, 4 for Thursday, 5 for Friday, 6 for Saturday.
firstDayOfWeek
- the index of the first day of the weekIllegalArgumentException
- if firstDayOfWeek is invalidpublic String getWeek()
week
.public DatePicker.DatePickerI18n setWeek(String week)
week
.week
- the translated word for weekpublic String getCalendar()
calendar
.public DatePicker.DatePickerI18n setCalendar(String calendar)
calendar
.calendar
- the translated word for calendarpublic String getClear()
clear
.public DatePicker.DatePickerI18n setClear(String clear)
clear
.clear
- the translated word for clearpublic String getToday()
today
.public DatePicker.DatePickerI18n setToday(String today)
today
.today
- the translated word for todaypublic String getCancel()
cancel
.public DatePicker.DatePickerI18n setCancel(String cancel)
cancel
.cancel
- the translated word for cancelpublic LocalDate getReferenceDate()
referenceDate
.public DatePicker.DatePickerI18n setReferenceDate(LocalDate referenceDate)
referenceDate
.
The reference date is used to determine the century when parsing two-digit years. The century that makes the date closest to the reference date is applied. The default value is the current date.
Example: for a reference date of 1970-10-30; years {10, 40, 80} become {2010, 1940, 1980}.
referenceDate
- the date used to base relative dates onCopyright © 2025. All rights reserved.