public interface IUIDateTime
Modifier and Type | Method and Description |
---|---|
UIDateTimeDataType |
getDataType()
Returns the date-time datatype for this component.
|
default GDateTime |
getDefaultValue()
Gets the default value of the component as a GDateTime.
|
default GDateTime |
getDefaultValue(LocaleInfo localeInfo)
Gets the default value of the component as a GDateTime.
|
int |
getFormat()
Gets the format used.
|
GDateTime.Type |
getGDateTimeType()
Returns the GDateTime datatype for this component.
|
default LocalDate |
getLocalDate()
Gets the local date part of the value.
|
default LocalTime |
getLocalTime()
Gets the local time part of the value.
|
int |
getMaximumYear()
Gets the maximum year for the mobile spinner.
|
int |
getMinimumYear()
Gets the minimum year for the mobile spinner.
|
UIDateTimeType |
getUIDateTimeType()
Returns the date-time type for this component.
|
GDateTime |
getValue()
Gets the current date-time value.
|
default ZoneId |
getZoneId()
Gets the zone of the value.
|
boolean |
hasCalendarButton()
Returns whether a button to show calendar should be present for date input (mobile only).
|
boolean |
isCalendarUsed()
Returns whether a calendar should be used for date input (mobile only).
|
boolean |
isDataTypeEnforced()
Returns if the enforcement of the datatype is set.
|
default boolean |
isDateValueRequired()
Returns if the implementation requires a date in the value component.
|
default boolean |
isDateValueSupported()
Returns if the implementation supports date.
|
boolean |
isDayMonthCombined()
Returns whether to combine day and month in a single spinner (mobile).
|
boolean |
isMillisecondsUsed()
Returns whether the time value should use milliseconds in time formats using seconds.
|
boolean |
isNullAllowed()
Returns if a null value is allowed, i.e.
|
default boolean |
isTimeValueRequired()
Returns if the implementation requires a time in the value component.
|
default boolean |
isTimeValueSupported()
Returns if the implementation supports time.
|
boolean |
isZoneUsed()
Returns whether the zone should be used for a ZonedTimeDate type.
|
boolean |
setCombineDayMonth(boolean on)
Sets whether to combine day and month in a single spinner (mobile).
|
default boolean |
setDate(LocalDate localDate)
Sets the value as a local date with the locale information of the current user session
(or system default) in case value conversion is required.
|
default boolean |
setDate(LocalDate localDate,
LocaleInfo localeInfo)
Sets the value as a local date.
|
boolean |
setFormat(int format)
Sets the format.
|
boolean |
setNullAllowed(boolean isNullAllowed)
Sets the null value allowed flag, i.e.
|
default boolean |
setTime(LocalTime localTime)
Sets the value as a local time with the locale information of the current user session (or system default)
in case value conversion is required.
|
default boolean |
setTime(LocalTime localTime,
LocaleInfo localeInfo)
Sets the value as a local time.
|
boolean |
setType(UIDateTimeType type,
UIDateTimeDataType dataType,
boolean doEnforceDataType)
Sets the date-time type, its datatype and the enforcement flag of the datatype.
|
boolean |
setUseCalendar(boolean on)
Sets whether a calendar should be used for date input (mobile only).
|
boolean |
setUseCalendarButton(boolean on)
Sets whether a calendar button should be shown for date input (mobile only).
|
boolean |
setUseMilliseconds(boolean on)
Sets whether the time value should use milliseconds in time formats using seconds.
|
boolean |
setUseZone(boolean on)
Sets whether the zone should be used for a ZonedTimeDate type.
|
default boolean |
setValue(GDateTime value)
Sets the date-time value with the locale information of the current user session (or system default)
in case value conversion is required.
|
boolean |
setValue(GDateTime value,
LocaleInfo localeInfo)
Sets the date-time value.
|
boolean |
setValueToNull()
Sets the value to null.
|
boolean |
setYearRange(int min,
int max)
Sets the minimum and maximum year for the mobile spinner.
|
default boolean |
setZoneId(ZoneId zone)
Sets the zone value.
|
UIDateTimeType getUIDateTimeType()
UIDateTimeDataType getDataType()
GDateTime.Type getGDateTimeType()
boolean isDataTypeEnforced()
boolean setType(UIDateTimeType type, UIDateTimeDataType dataType, boolean doEnforceDataType)
Note 1: This method DOES NOT change the value, so the value may end up in the wrong datatype, and you should ensure that this does not occur.
Note 2: The doEnforceDataType
is always true for ZoneId type.
type
- The type.dataType
- The datatype.IllegalArgumentException
- If the type does not support the dataType.boolean isNullAllowed()
boolean setNullAllowed(boolean isNullAllowed)
Setting this parameter isNullAllowed
to false when the value already is null
will not affect the value.
isNullAllowed
- Flag for null allowed.boolean setValueToNull()
IllegalStateException
- If the flag isNullAllowed()
is false
.default boolean setValue(GDateTime value)
value
- The value to set, null may be allowed depending on the flag returned
by isNullAllowed()
.IllegalArgumentException
- If the date/time type is enforced and not matching.IllegalStateException
- If the date/time conversion cannot possibly take place due to type mismatch.NullPointerException
- If the value is null and allow null is not enabled.boolean setValue(GDateTime value, LocaleInfo localeInfo)
value
- The value to set, null may be allowed depending on the flag returned
by isNullAllowed()
.localeInfo
- The locale information to use, or null to use the current user's or system default.IllegalArgumentException
- If the date/time type is enforced and not matching.IllegalStateException
- If the date/time conversion cannot possibly take place due to type mismatch.NullPointerException
- If the value is null and allow null is not enabled.GDateTime getValue()
null
if the value is null and the flag isNullAllowed()
is set. The value may still be null if the "null-allowed" flag has been toggled recently
programmatically to false
but the value has not been assigned yet.default GDateTime getDefaultValue()
Time
), the epoch date as a LocalDate (1st of January
1970 for type Date
), the combination of the two above for type
DateTime
, and the current Zone ID of the user's session (or system default)
for ZoneId
.default GDateTime getDefaultValue(LocaleInfo localeInfo)
localeInfo
- The locale information to use when retrieving the Zone ID, null for
current user's locale or system default.TIME
,
the epoch date as a LocalDate, i.e. 1st of January 1970 for type DATE
and the combination of the two above for type DATE_TIME
.default boolean isTimeValueSupported()
default boolean isTimeValueRequired()
default LocalTime getLocalTime()
IllegalStateException
- If the value doesn't contain a time part, i.e. it's the wrong datatype.default boolean setTime(LocalTime localTime)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the time part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
localTime
- The local time to set, null is not allowed.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Date
.NullPointerException
- If localTime
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.default boolean setTime(LocalTime localTime, LocaleInfo localeInfo)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the time part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
localTime
- The local time to set, null is not allowed.localeInfo
- The locale information to use, or null to use the current user's or system default.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Date
or
UIDateTimeType.ZoneId
.NullPointerException
- If localTime
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.default boolean isDateValueSupported()
default boolean isDateValueRequired()
default LocalDate getLocalDate()
IllegalStateException
- If the value doesn't contain a date part, i.e. it's the wrong datatype.default boolean setDate(LocalDate localDate)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the date part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
localDate
- The local date to set, null is not allowed.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Time
.NullPointerException
- If localDate
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.default boolean setDate(LocalDate localDate, LocaleInfo localeInfo)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the date part of the value and keep offset, zone and/or date parts.
To set the entire value, use
or
setValue(GDateTime)
.setValue(GDateTime, LocaleInfo)
localDate
- The local date to set, null is not allowed.localeInfo
- The locale information to use, or null to use the current user's or system default.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.Time
or
UIDateTimeType.ZoneId
.NullPointerException
- If localDate
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.default ZoneId getZoneId()
default boolean setZoneId(ZoneId zone)
If the component is configured for the UIDateTimeType.DateTime
, this will
change only the zone part of the value.
zone
- The local date to set, null is not allowed.IllegalArgumentException
- If the date/time type is enforced and not matching, or
in case the datatype is UIDateTimeType.ZoneId
.NullPointerException
- If zone
is null or in case the CURRENT value
is null and the datatype is UIDateTimeType.DateTime
.int getFormat()
boolean setFormat(int format)
format
- The format as 0=short, 1=normal, 2=long or 3=full (default).IllegalArgumentException
- If the format is not 0-3.int getMinimumYear()
int getMaximumYear()
boolean setYearRange(int min, int max)
min
- The minimum year, or -1 for no minimum, i.e. current year minus 20.max
- The maximum year, or -1 for no maximum, i.e. current year plus 20.IllegalArgumentException
- If the min is larger than max or if either min or max is not in the range of 0-10000.boolean isZoneUsed()
boolean setUseZone(boolean on)
on
- The flag.boolean isCalendarUsed()
boolean setUseCalendar(boolean on)
on
- The flag.boolean hasCalendarButton()
boolean setUseCalendarButton(boolean on)
on
- The flag.boolean isMillisecondsUsed()
boolean setUseMilliseconds(boolean on)
on
- The flag.boolean isDayMonthCombined()
boolean setCombineDayMonth(boolean on)
on
- The flag.iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.