Interface IUIDateTime
- All Known Implementing Classes:
- EUIDateTime,- MLDateTime,- UIDateTime
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescriptionReturns the date-time datatype for this component.- default GDateTimeGets the default value of the component as a GDateTime.- default GDateTime- getDefaultValue- (LocaleInfo localeInfo) Gets the default value of the component as a GDateTime.- intGets the format used.Returns the GDateTime datatype for this component.- default LocalDateGets the local date part of the value.- default LocalTimeGets the local time part of the value.- intGets the maximum year for the mobile spinner.- intGets the minimum year for the mobile spinner.Returns the date-time type for this component.- getValue()Gets the current date-time value.- default ZoneIdGets the zone of the value.- booleanReturns whether a button to show calendar should be present for date input (mobile only).- booleanReturns whether a calendar should be used for date input (mobile only).- booleanReturns if the enforcement of the datatype is set.- default booleanReturns if the implementation requires a date in the value component.- default booleanReturns if the implementation supports date.- booleanReturns whether to combine day and month in a single spinner (mobile).- booleanReturns whether the time value should use milliseconds in time formats using seconds.- booleanReturns if a null value is allowed, i.e.- default booleanReturns if the implementation requires a time in the value component.- default booleanReturns if the implementation supports time.- booleanReturns 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 booleanSets 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 booleanSets 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 booleanSets 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.- booleanSets the value to null.- boolean- setYearRange- (int min, int max) Sets the minimum and maximum year for the mobile spinner.- default booleanSets the zone value.
- Method Details- getUIDateTimeTypeUIDateTimeType getUIDateTimeType()Returns the date-time type for this component.- Returns:
- Enum value as Time, Date, DateTime or ZoneId.
 
- getDataTypeUIDateTimeDataType getDataType()Returns the date-time datatype for this component.- Returns:
- Enum value as Time, Date, DateTime or ZoneId.
 
- getGDateTimeTypeGDateTime.Type getGDateTimeType()Returns the GDateTime datatype for this component.- Returns:
- Enum value as LocalTime, OffsetTime, LocalDate, LocalDateTime, OffsetDateTime or ZonedDateTime.
 
- isDataTypeEnforcedboolean isDataTypeEnforced()Returns if the enforcement of the datatype is set.- Returns:
- true if the datatype when setting the value MUST be exactly the same datatype, or false (default) to allow conversion to the internal configured datatype. In the Designer, this value is called "Allow data conversion", and is default true.
 
- setTypeSets the date-time type, its datatype and the enforcement flag of the datatype.- 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 - doEnforceDataTypeis always true for ZoneId type.- Parameters:
- type- The type.
- dataType- The datatype.
- Returns:
- true if a change of type, datatype or enforcement occurred, false for no change.
- Throws:
- IllegalArgumentException- If the type does not support the dataType.
 
- isNullAllowedboolean isNullAllowed()Returns if a null value is allowed, i.e. no date/time value is set and the UI component is blank.- Returns:
- true if null is allowed, or false (default) if not allowed.
 
- setNullAllowedboolean setNullAllowed- (boolean isNullAllowed) Sets the null value allowed flag, i.e. allows no date/time value to be set and the UI component is blank.- Setting this parameter - isNullAllowedto false when the value already is- nullwill not affect the value.- Parameters:
- isNullAllowed- Flag for null allowed.
- Returns:
- true if the setting changed, false for no change.
 
- setValueToNullboolean setValueToNull()Sets the value to null.- Returns:
- true for value changed, false for no change.
- Throws:
- IllegalStateException- If the flag- isNullAllowed()- false.
 
- setValueSets the date-time value with the locale information of the current user session (or system default) in case value conversion is required.- Parameters:
- value- The value to set, null may be allowed depending on the flag returned by- isNullAllowed()
- Returns:
- true for value changed, false for no change to the value.
- Throws:
- 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.
 
- setValueSets the date-time value.- Parameters:
- 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.
- Returns:
- true for value changed, false for no change to the value.
- Throws:
- 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.
 
- getValueGDateTime getValue()Gets the current date-time value.- Returns:
- The current value as configured with its datatype's corresponding GDateTime value, or nullif the value is null and the flagisNullAllowed()falsebut the value has not been assigned yet.
 
- getDefaultValueGets the default value of the component as a GDateTime.- Returns:
- The default value depends on the date/time type, i.e. the time as midnight as a LocalTime (00:00:00 for type Time), the epoch date as a LocalDate (1st of January 1970 for typeDate), the combination of the two above for typeDateTime, and the current Zone ID of the user's session (or system default) forZoneId.
 
- getDefaultValueGets the default value of the component as a GDateTime.- Parameters:
- localeInfo- The locale information to use when retrieving the Zone ID, null for current user's locale or system default.
- Returns:
- The time as midnight as a LocalTime, i.e. 00:00:00 for type TIME, the epoch date as a LocalDate, i.e. 1st of January 1970 for typeDATEand the combination of the two above for typeDATE_TIME.
 
- isTimeValueSupporteddefault boolean isTimeValueSupported()Returns if the implementation supports time.- Returns:
- false when time is not supported, true when setting a value requires a time part.
 
- isTimeValueRequireddefault boolean isTimeValueRequired()Returns if the implementation requires a time in the value component.- Returns:
- true when time is required in the component, and null is not allowed.
 
- getLocalTimeGets the local time part of the value.- Returns:
- Only the time part of the value, or null if the value is null.
- Throws:
- IllegalStateException- If the value doesn't contain a time part, i.e. it's the wrong datatype.
 
- setTimeSets the value as a local time with the locale information of the current user session (or system default) in case value conversion is required.- 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- setValue(GDateTime)- setValue(GDateTime, LocaleInfo)- Parameters:
- localTime- The local time to set, null is not allowed.
- Throws:
- IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype is- UIDateTimeType.Date.
- NullPointerException- If- localTimeis null or in case the CURRENT value is null and the datatype is- UIDateTimeType.DateTime.
 
- setTimeSets the value as a local time.- 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- setValue(GDateTime)- setValue(GDateTime, LocaleInfo)- Parameters:
- 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.
- Throws:
- IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype is- UIDateTimeType.Dateor- UIDateTimeType.ZoneId.
- NullPointerException- If- localTimeis null or in case the CURRENT value is null and the datatype is- UIDateTimeType.DateTime.
 
- isDateValueSupporteddefault boolean isDateValueSupported()Returns if the implementation supports date.- Returns:
- false when date is not supported, true when setting a value requires a date part.
 
- isDateValueRequireddefault boolean isDateValueRequired()Returns if the implementation requires a date in the value component.- Returns:
- true when date is required in the component, and null is not allowed.
 
- getLocalDateGets the local date part of the value.- Returns:
- Only the date part of the value, or null if the value is null.
- Throws:
- IllegalStateException- If the value doesn't contain a date part, i.e. it's the wrong datatype.
 
- setDateSets the value as a local date with the locale information of the current user session (or system default) in case value conversion is required.- 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- setValue(GDateTime)- setValue(GDateTime, LocaleInfo)- Parameters:
- localDate- The local date to set, null is not allowed.
- Throws:
- IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype is- UIDateTimeType.Time.
- NullPointerException- If- localDateis null or in case the CURRENT value is null and the datatype is- UIDateTimeType.DateTime.
 
- setDateSets the value as a local date.- 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- setValue(GDateTime)- setValue(GDateTime, LocaleInfo)- Parameters:
- 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.
- Throws:
- IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype is- UIDateTimeType.Timeor- UIDateTimeType.ZoneId.
- NullPointerException- If- localDateis null or in case the CURRENT value is null and the datatype is- UIDateTimeType.DateTime.
 
- getZoneIdGets the zone of the value.- Returns:
- Only the zone part of the value, or null if the value is null or doesn't have a zone. It is non-null only when the value is non-null and datatype is one of OffsetTime, OffsetDateTime, ZonedDateTime or ZoneId.
 
- setZoneIdSets the zone value.- If the component is configured for the - UIDateTimeType.DateTime, this will change only the zone part of the value.- Parameters:
- zone- The local date to set, null is not allowed.
- Throws:
- IllegalArgumentException- If the date/time type is enforced and not matching, or in case the datatype is- UIDateTimeType.ZoneId.
- NullPointerException- If- zoneis null or in case the CURRENT value is null and the datatype is- UIDateTimeType.DateTime.
 
- getFormatint getFormat()Gets the format used.- Returns:
- The format as 0=short, 1=normal, 2=long or 3=full (default).
 
- setFormatboolean setFormat- (int format) Sets the format.- Parameters:
- format- The format as 0=short, 1=normal, 2=long or 3=full (default).
- Returns:
- true for changes, false for no change.
- Throws:
- IllegalArgumentException- If the format is not 0-3.
 
- getMinimumYearint getMinimumYear()Gets the minimum year for the mobile spinner.- Returns:
- The minimum year, or -1 if undefined.
 
- getMaximumYearint getMaximumYear()Gets the maximum year for the mobile spinner.- Returns:
- The minimum year, or -1 if undefined.
 
- setYearRangeboolean setYearRange- (int min, int max) Sets the minimum and maximum year for the mobile spinner.- Parameters:
- 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.
- Returns:
- true for changed, false for no change.
- Throws:
- IllegalArgumentException- If the min is larger than max or if either min or max is not in the range of 0-10000.
 
- isZoneUsedboolean isZoneUsed()Returns whether the zone should be used for a ZonedTimeDate type.- Returns:
- true to use the zone or false (default) not to use the zone.
 
- setUseZoneboolean setUseZone- (boolean on) Sets whether the zone should be used for a ZonedTimeDate type.- Parameters:
- on- The flag.
- Returns:
- true for changes, false for no change.
 
- isCalendarUsedboolean isCalendarUsed()Returns whether a calendar should be used for date input (mobile only).- Returns:
- true to use the calendar or false (default) to use spinners.
 
- setUseCalendarboolean setUseCalendar- (boolean on) Sets whether a calendar should be used for date input (mobile only).- Parameters:
- on- The flag.
- Returns:
- true for changes, false for no change.
 
- hasCalendarButtonboolean hasCalendarButton()Returns whether a button to show calendar should be present for date input (mobile only).- Returns:
- true to use the calendar or false (default) to use spinners.
 
- setUseCalendarButtonboolean setUseCalendarButton- (boolean on) Sets whether a calendar button should be shown for date input (mobile only).- Parameters:
- on- The flag.
- Returns:
- true for changes, false for no change.
 
- isMillisecondsUsedboolean isMillisecondsUsed()Returns whether the time value should use milliseconds in time formats using seconds.- Returns:
- true to use the zone or false (default) not to use the zone.
 
- setUseMillisecondsboolean setUseMilliseconds- (boolean on) Sets whether the time value should use milliseconds in time formats using seconds.- Parameters:
- on- The flag.
- Returns:
- true for changes, false for no change.
 
- isDayMonthCombinedboolean isDayMonthCombined()Returns whether to combine day and month in a single spinner (mobile).- Returns:
- The flag, default false.
 
- setCombineDayMonthboolean setCombineDayMonth- (boolean on) Sets whether to combine day and month in a single spinner (mobile).- Parameters:
- on- The flag.
- Returns:
- true for changes, false for no change.