Date/Time
A 'Date/Time' field is used to display or record a date, time, or both in combination.
An absolute or relative default value can be defined for the field.
User input can be limited to an absolute or relative specified interval (Start date/To date).
Date selection can be limited to working days according to a selectable Calendar (with weekly scheme, exceptions and holidays).
Which day of the week the calendar shows as the first day of the week can be set in the 'lobsterui/firstDayOfWeek' entry in the localization (0 is Sunday and 6 is Saturday).
The following settings can be made for each Date/Time field:
(1) Under Use holiday list, a Calendar can optionally be specified, according to which it is determined whether a day is a working day or not.
(2) The option Working days only defines that the date selection only allows days that are working days according to the Calendar defined by the option (1) (week schema, exceptions, holiday groups).
In the example, Monday to Saturday are generally considered as working days and for 04. July and 23. July there are exceptions or holidays, which are shaded gray with a comment by a tooltip.
►NOTE◄ The option Working days only is also taken into account in the preset (4).
(3) Specifies which components of Date/Time are to be displayed:
Display date |
|
Display time |
|
Display date |
|
Display date |
|
Tip: To show/hide the time and date at form runtime, the Time visibility and Date visibility actions can also be applied to the date field.
If no time zone is offered for selection, the default time zone is used.
This can be overridden via the time zone settings of the company or the user (in this order).
The time zone used to record the time is displayed in the date field tooltip.
(4) The specifications under Default date: determine whether, with which method (abolute/relative) and with which value the date field is to be preset.
|
Variant 1: Absolute default of date and time Date and time are preset with absolute values (1). (2) Deletes the default setting completely. |
|
Variant 2: Relative default date and time The 'Today' option displays an Offset (days) (2) field that adds a certain number of days to the execution date (system time). Example on 28.05.2018 at 15:08 with the settings made on the left would result in:
However, the default setting also takes into account the specified calendar (weekly schedule, exceptions, holidays), if the option Working days only is set. ►IMPORTANT◄ When using an offset, the check against the calendar is performed starting from 'Today' (or 'Now') forward or backward by days until as many working days have been 'found' in the respective direction as are specified as offset. In a calendar with a working week from Monday to Friday and without holidays and exceptions, an offset of +5 or -5 results in a target date with the same weekday if 'Today' is a working day. If 'Today' is not a working day, the next working day is preset at an offset of 0. In case of positive or negative offsets, it is ensured that there are at least as many working days between today and the target date as the offset requires. Example:
If a new business object is created 'Today' (Saturday), the upcoming Wednesday appears as the default for the shipping date, since the offset of 1 is only offset by Monday as a working day. On the previous day (Friday, working day), the offset of 1 would still have referred to Monday as the 'next working day'. |
|
Variant 3: Relative default date with absolute time If only the option 'Today' is set, but not 'Now', then the relative date determination is done as above, but for the target date an absolute defined time is set. In the example, the date field is preset with a value corresponding to the following day (or working day) at 17:00. |
|
Variant 4: Absolute default date with relative default time If only the option 'Now' is set, but not 'Today', then the default combines the absolute specified date with a time calculated relative to the current system time. In the more academic example on the left, the date field is pre-populated starting from 24.12.2018 with a time offset that is one hour (3,600,000 milliseconds) after the current system time. In the case of suitably large or small offsets, it can happen with this variant that the target date does not correspond to the absolute date from the specification. |
(5) Start and end date can be specified analog to (4) with offset and time. The period for permissible entries can be limited on one or both sides. Invalid date values are shaded in the selection area.
As an example, a period with a start from Today (11.07.2018 00:00) until in 5 working days at 12:00 was defined as permissible. In the monthly overview, the days 11, 13, 14, 16, 17, 18 appear selectable (not shaded).
If you select the latest permissible date (18.07.18) based on the default setting for the time 17:00, the selection is accepted, but is still rejected as invalid by a default message.
The input is 'not valid' until a permissible time (max. 12:00) is specified.
(6) In addition to the restrictions described in (5), Validators can also be defined for date fields.
In the example, an additional restriction for the date range was specified in this way, namely that the value for Delivery by: must not be before the Pickup date requested.
In the example scenario, this rule is violated, although the delivery date is basically within the permissible range.
►NOTE◄ If the rule violation occurs because the pickup date was changed subsequently, the message text for the validator appears on delivery, only when this element is validated again. For example, before saving, when the value is changed, or by validating the element by behaviour.
(7) Enables/disables the time zone setting. Which time zones should be available can be determined via an entry configuration:
If Show time zone is enabled, the user will see an additional Time zone section in the calendar.
(8) Determines whether the time is reset to 00:00:00.000 when the date is changed. For backward compatibility, this property is enabled by default in inventory forms for date fields that do not display the time.
Display type 'Calendar'
Using the 'Calendar' display type, date fields can also be displayed as a scalable calendar. For details see View type 'Calendar' (Date/Time).