Table of Contents

Input datetime

Live demo

Renders a datetime input field.

Node name : input-date-time

Attributes

Bound

Attribute Type Required Default value Description
property-name string true UI view property name
item UI view false @DatasourceCurrent Item to be bound to

Unbound

Attribute Type Required Default value Description
value string true Input value.
label string false Input label.
placeholder string false Placeholder specifies a short hint that describes the expected value of an input field. The short hint is displayed in the input field before the user enters a value.
disabled bool false false Value indicating whether the input is disabled
readonly bool false false Value indicating whether the input is read-only.
required bool false false Value indicating whether the input is required.
message-text string false Additional message displayed next to the component. Usually a warning or an error message.
message-severity string (information, warning, error) false Severity of the additional message displayed next to the component.
documentation string false Documentation
tab-stop bool false true Value indicating whether the input can be focused using the Tab key.
value-changed string false Name of the method called when the value has changed. The first parameter is the value and the second is the current item of the data source (DatasourceCurrent) or the iterated item in a repeat component.
format string false Used to display the selected date and time
min-value DateTime false Represents the smallest possible value that can be entered
max-value DateTime false Represents the largest possible value that can be entered

Common

Attribute Type Required Default value Description
label-position string (top, left, right, hidden) false top Input label position.
message-position string (bottom, hidden) false bottom Input message position.
focused bool false false Value indicating whether the component is focused.

Remarks

The format string is expressed as a .NET-style Standard date and time format strings or Custom date and time format strings.

The following table describes some of the standard date and time format specifiers:

Format Description Examples
G General date/time pattern (long time). 2009-06-15T13:45:30 -> 6/15/2009 1:45:30 PM (en-US)
2009-06-15T13:45:30 -> 15/06/2009 13:45:30 (fr-FR)
F Full date/time pattern (long time). 2009-06-15T13:45:30 -> Monday, June 15, 2009 1:45:30 PM (en-US)
2009-06-15T13:45:30 -> Lundi 15 Juin 2009 13:45:30 (fr-FR)
yyyy-MM-ddThh:mm:ss.fffK Custom pattern (ISO 8601). 2009-06-15T13:45:30 -> 2009-06-15T13:45:30.000+01:00

Minimum and maximum values can be represented by expressions at UI view level, whereas they are only constants at entity and entity view level.

Min/Max values for DateTime and InvariantDateTime data types (format ISO 8086 "yyyy-MM-ddTHH:mm:ss.fffffffK"):

Local Time

2009-06-15T13:45:30.0000000-07:00

UTC Time

2009-06-15T13:45:30.0000000Z

Unspecified Time

2009-06-15T13:45:30.0000000

Min/Max value as expression (e.g. minimum date is that of the previous month):

return DateTime.Now.AddMonth(-1);

Important

Most of the time you will use the calendar to select a date/time. But keyboard input is possible; in this case if a display format has been defined it is obviously supported; otherwise the supported formats are the following:

Format Description Examples
d Short date pattern. 6/15/2009 (en-US)
15/06/2009 (fr-FR)
g General date/time pattern (short time). 6/15/2009 1:45 PM (en-US)
15/06/2009 13:45 (fr-FR)
G General date/time pattern (long time). 6/15/2009 1:45:30 PM (en-US)
15/06/2009 13:45:30 (fr-FR)
s Sortable date/time pattern. 2009-06-15T13:45:30
o Round-trip date/time pattern (ISO 8601). 2009-06-15T13:45:30.0000000-07:00
2009-06-15T13:45:30.0000000Z
u Universal sortable date/time pattern. 2009-06-15 13:45:30Z
Note

Two-digit years are converted to full years based on the value entered for the year. Two-digit values between 30 and 99 are interpreted as 19xx, and values between 00 and 29 as 20xx.

Examples

Bound

<input-date-time property-name="DateTime" />

Unbound

<input-date-time value="@Fields.Value" label="myLabel" disabled="true" readonly="true" required="true" />
<input-date-time value="@Fields.Value" label="myLabel" format="dd/MM/yyyy HH:mm:ss" min-value="@Fields.MinDate" max-value="@Fields.MaxDate" />