public class DateTimeFormElementConfiguration extends HashMap<String,Object>
DateTimeFormElement based on
Tempus Dominus datepicker.| Modifier and Type | Class and Description |
|---|---|
static class |
DateTimeFormElementConfiguration.Format
Format will automatically set the patterns to be used.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static Locale |
DEFAULT_LOCALE |
static ZoneId |
DEFAULT_ZONE_ID |
static String |
FMT_EXPORT_JAVA |
static String |
FMT_EXPORT_MOMENT_DATE |
static String |
FMT_EXPORT_MOMENT_DATETIME |
static String |
FMT_EXPORT_MOMENT_TIME |
static String |
FMT_EXTRA_PATTERN_DATE |
static String |
FMT_PATTERN_DATE |
static String |
FMT_PATTERN_DATE_FULL |
static String |
FMT_PATTERN_DATETIME |
static String |
FMT_PATTERN_DATETIME_FULL |
static String |
FMT_PATTERN_TIME |
static DateTimeFormatter |
JAVA_DATE_TIME_FORMATTER |
static org.apache.commons.lang3.time.FastDateFormat |
JAVA_FORMATTER |
| Constructor and Description |
|---|
DateTimeFormElementConfiguration() |
DateTimeFormElementConfiguration(DateTimeFormElementConfiguration.Format format) |
DateTimeFormElementConfiguration(DateTimeFormElementConfiguration.Format format,
ZoneId zoneId) |
DateTimeFormElementConfiguration(DateTimeFormElementConfiguration existing)
Create a copy of an existing configuration.
|
DateTimeFormElementConfiguration(ZoneId zoneId) |
| Modifier and Type | Method and Description |
|---|---|
DateFormat |
createDateFormat() |
DateTimeFormatter |
createDateTimeFormatter() |
LocalDateTime |
dateToLocalDateTime(Date date)
|
DateTimeFormElementConfiguration.Format |
getFormat()
Get the format that this configuration is primarily meant for.
|
ZoneId |
getZoneId()
Get the id of the zone this configuration primarily uses to convert between date types.
|
boolean |
isLocalizePatterns() |
Date |
localDateTimeToDate(LocalDateTime date)
|
static LocalDateTime |
localDateToLocalDateTime(LocalDate date)
Converts a
LocalDate to a LocalDateTime with time equal to the start of the day. |
DateTimeFormElementConfiguration |
localize(Locale locale)
Create a localized copy of the current configuration.
|
static LocalDateTime |
localTimeToLocalDateTime(LocalTime time)
Converts a
LocalTime to a LocalDateTime with the day equal to today. |
void |
setDateAttribute(String attributeName,
Date... dates)
Set any date attribute on the configuration.
|
void |
setDateAttribute(String attributeName,
LocalDate... dates)
Set any date attribute on the configuration.
|
void |
setDateAttribute(String attributeName,
LocalDateTime... dates)
Set any date attribute on the configuration.
|
void |
setDateAttribute(String attributeName,
LocalTime... dates)
Set any date attribute on the configuration.
|
void |
setDaysOfWeekDisabled(int... daysOfWeek)
Disables the section of days of the week, e.g.
|
void |
setDefaultDate(Date date)
Sets the picker default date/time.
|
void |
setDefaultDate(LocalDate date)
Sets the picker default date/time.
|
void |
setDefaultDate(LocalDateTime date)
Sets the picker default date/time.
|
void |
setDefaultDate(LocalTime date)
Sets the picker default date/time.
|
void |
setDisabledDates(Date... dates)
Disables selection of dates in the array, e.g.
|
void |
setDisabledDates(LocalDate... dates)
Disables selection of dates in the array, e.g.
|
void |
setDisabledDates(LocalDateTime... dates)
Disables selection of dates in the array, e.g.
|
void |
setEnabledDates(Date... dates)
Disables selection of dates NOT in the array, e.g.
|
void |
setEnabledDates(LocalDate... dates)
Disables selection of dates NOT in the array, e.g.
|
void |
setEnabledDates(LocalDateTime... dates)
Disables selection of dates NOT in the array, e.g.
|
void |
setExportPattern(String pattern)
Set the serialization format that should be used.
|
void |
setExtraPatterns(String... patterns)
Set extra input patterns that should be supported (in moment js format).
|
void |
setFormat(@NonNull DateTimeFormElementConfiguration.Format format)
This will automatically set the different attributes and patterns to be used.
|
void |
setKeepInvalid(boolean keepInvalid)
Will cause the date picker to not revert or overwrite invalid dates.
|
void |
setKeepOpen(boolean keepOpen)
Will cause the date picker to stay open after selecting a date if no time components are being used.
|
void |
setLocale(Locale locale) |
void |
setLocalizePatterns(boolean localizePatterns)
Set to
true if calls to localize(Locale) will create a version of the current configuration
adapted to the locale specified. |
void |
setMaxDate(Date date)
Prevents date/time selections after this date
|
void |
setMaxDate(LocalDate date)
Prevents date/time selections after this date
|
void |
setMaxDate(LocalDateTime date)
Prevents date/time selections after this date
|
void |
setMaxDate(LocalTime date)
Prevents date/time selections after this date
|
void |
setMinDate(Date date)
Prevents date/time selections before this date
|
void |
setMinDate(LocalDate date)
Prevents date/time selections before this date
|
void |
setMinDate(LocalDateTime date)
Prevents date/time selections before this date
|
void |
setMinDate(LocalTime date)
Prevents date/time selections before this date
|
void |
setPattern(String pattern)
Set the primary input/output pattern in moment js format.
|
void |
setShowCalendarWeeks(boolean showCalendarWeeks)
Shows the week of the year to the left of first day of the week.
|
void |
setShowClearButton(boolean showClearButton)
Show the "Clear" button in the icon toolbar.
|
void |
setShowCloseButton(boolean showCloseButton)
Show the "Close" button in the icon toolbar.
|
void |
setShowInline(boolean showInline)
Will display the picker inline without the need of a input field.
|
void |
setShowTodayButton(boolean showTodayButton)
Show the "Today" button in the icon toolbar.
|
void |
setSideBySide(boolean sideBySide)
Shows the picker side by side when using the time and date together.
|
void |
setStepping(int minutes)
Number of minutes the up/down arrow's will move the minutes value in the time picker
|
void |
setUseCurrentDate(boolean useCurrent)
On show, will set the picker to the current date/time
|
void |
setViewDate(Date date)
This will change the viewDate without changing or setting the selected date.
|
void |
setViewDate(LocalDate date)
This will change the viewDate without changing or setting the selected date.
|
void |
setViewDate(LocalDateTime date)
This will change the viewDate without changing or setting the selected date.
|
void |
setViewDate(LocalTime date)
This will change the viewDate without changing or setting the selected date.
|
void |
setZoneId(ZoneId zoneId)
This will ensure that conversion between
Date and LocalDateTime,
LocalDate, LocalTime use the same time zone. |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic static final String FMT_EXPORT_JAVA
public static final String FMT_EXPORT_MOMENT_DATE
public static final String FMT_EXPORT_MOMENT_TIME
public static final String FMT_EXPORT_MOMENT_DATETIME
public static final String FMT_PATTERN_DATE
public static final String FMT_PATTERN_DATE_FULL
public static final String FMT_PATTERN_TIME
public static final String FMT_PATTERN_DATETIME
public static final String FMT_PATTERN_DATETIME_FULL
public static final String FMT_EXTRA_PATTERN_DATE
public static final Locale DEFAULT_LOCALE
public static final ZoneId DEFAULT_ZONE_ID
public static final org.apache.commons.lang3.time.FastDateFormat JAVA_FORMATTER
public static final DateTimeFormatter JAVA_DATE_TIME_FORMATTER
public DateTimeFormElementConfiguration()
public DateTimeFormElementConfiguration(DateTimeFormElementConfiguration.Format format)
public DateTimeFormElementConfiguration(ZoneId zoneId)
public DateTimeFormElementConfiguration(DateTimeFormElementConfiguration.Format format, ZoneId zoneId)
public DateTimeFormElementConfiguration(DateTimeFormElementConfiguration existing)
existing - configuration to copypublic DateTimeFormElementConfiguration.Format getFormat()
public void setFormat(@NonNull
@NonNull DateTimeFormElementConfiguration.Format format)
format - to usepublic ZoneId getZoneId()
public void setZoneId(ZoneId zoneId)
Date and LocalDateTime,
LocalDate, LocalTime use the same time zone.zoneId - to use.public void setPattern(String pattern)
setFormat(Format) would suffice.pattern - in moment js formatpublic void setExtraPatterns(String... patterns)
setFormat(Format) would suffice. Note that you should always
add the setExportPattern(String) to the list of extra patterns as well.patterns - in moment js formatpublic void setExportPattern(String pattern)
setFormat(Format) would suffice.pattern - in moment js formatpublic void setLocale(Locale locale)
public void setStepping(int minutes)
minutes - per steppublic void setMinDate(Date date)
public void setMinDate(LocalDate date)
public void setMinDate(LocalTime date)
public void setMinDate(LocalDateTime date)
public void setMaxDate(Date date)
public void setMaxDate(LocalDate date)
public void setMaxDate(LocalTime date)
public void setMaxDate(LocalDateTime date)
public void setUseCurrentDate(boolean useCurrent)
public void setDefaultDate(Date date)
public void setDefaultDate(LocalDate date)
public void setDefaultDate(LocalTime date)
public void setDefaultDate(LocalDateTime date)
public void setViewDate(Date date)
public void setViewDate(LocalDate date)
public void setViewDate(LocalTime date)
public void setViewDate(LocalDateTime date)
public void setDisabledDates(Date... dates)
public void setDisabledDates(LocalDate... dates)
public void setDisabledDates(LocalDateTime... dates)
public void setEnabledDates(Date... dates)
public void setEnabledDates(LocalDate... dates)
public void setEnabledDates(LocalDateTime... dates)
public void setSideBySide(boolean sideBySide)
public void setDaysOfWeekDisabled(int... daysOfWeek)
public void setShowCalendarWeeks(boolean showCalendarWeeks)
public void setShowTodayButton(boolean showTodayButton)
public void setShowClearButton(boolean showClearButton)
public void setShowCloseButton(boolean showCloseButton)
public void setKeepOpen(boolean keepOpen)
public void setShowInline(boolean showInline)
public void setKeepInvalid(boolean keepInvalid)
public void setDateAttribute(String attributeName, Date... dates)
public LocalDateTime dateToLocalDateTime(Date date)
public Date localDateTimeToDate(LocalDateTime date)
public void setDateAttribute(String attributeName, LocalDate... dates)
public static LocalDateTime localDateToLocalDateTime(LocalDate date)
LocalDate to a LocalDateTime with time equal to the start of the day.public void setDateAttribute(String attributeName, LocalTime... dates)
public static LocalDateTime localTimeToLocalDateTime(LocalTime time)
LocalTime to a LocalDateTime with the day equal to today.public void setDateAttribute(String attributeName, LocalDateTime... dates)
public boolean isLocalizePatterns()
public void setLocalizePatterns(boolean localizePatterns)
true if calls to localize(Locale) will create a version of the current configuration
adapted to the locale specified. If false localize calls will create an exact duplicate of the
configuration, no matter the output locale. Default value is true.localizePatterns - true if output locale should be taken into accountpublic DateTimeFormElementConfiguration localize(Locale locale)
locale - for which to create a localized instancepublic DateFormat createDateFormat()
DateFormat representing the current configuration.public DateTimeFormatter createDateTimeFormatter()
DateTimeFormatter representing the current configuration.Copyright © 2020. All rights reserved.