Table of Contents

Input date

Live demo

Renders a date input field.

Node name : input-date

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
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 format specifiers:

Format Description Examples
d Short date pattern. 2009-06-15T13:45:30 -> 6/15/2009 (en-US)
2009-06-15T13:45:30 -> 15/06/2009 (fr-FR)
D Long date pattern. 2009-06-15T13:45:30 -> Monday, June 15, 2009 (en-US)
2009-06-15T13:45:30 -> Lundi 15 Juin 2009 (fr-FR)
yyyy-MM-dd Custom pattern. 2009-06-15T13:45:30 -> 2009-06-15

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 Date data type (format ISO 8086 "yyyy-MM-dd"):

2009-06-15

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

return DateTime.Today.AddMonth(-1);

Important

Most of the time you will use the calendar to select a date. 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)
yyyy-MM-dd Sortable date pattern. 2009-06-15
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 property-name="Date" />

Unbound

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