DateField
A Date field widget consisting of a date input field + a date picker.
It can be configured to allow user typing dates, or to only allow selection from the date picker (see editable). It can also validate that the date is within a specified range (see min -> max). It also optionally show step triggers to increment or decrement the date (see step & stepTriggers):
This field can be used as an editor for a grid column. It is used as the default editor for the DateColumn class.
// minimal DateField config with date format specified
const dateField = new DateField({
format: 'YYMMDD'
});
Accessibility
This widget can be operated using the keyboard. When the field is focused, ArrowDown opens the date picker, which itself is keyboard navigable. Shift+ArrowDown activates the step back trigger. Shift+ArrowUp activates the step forwards trigger.
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Format for date displayed in field. Defaults to using long date format, as defined by current locale (
L)Has a corresponding runtime format property.
-
Max value
Has a corresponding runtime max property.
-
Min value
Has a corresponding runtime min property.
-
Format for date in the picker. Uses localized format per default
-
Time increment duration value. If specified,
forwardandbacktriggers are displayed. The value is taken to be a string consisting of the numeric magnitude and the units. The units may be a recognised unit abbreviation of this locale or the full local unit name. For example'1d'or'1w'or'1 week'. This may be specified as an object containing two properties:magnitude, a Number, andunit, a StringHas a corresponding runtime step property.
-
Set to
falseto hide the forward and backward date step triggers. These triggers are only shown when step is set. -
triggers : Object<String, FieldTriggerConfig>
Widgets that trigger functionality upon click. Each trigger icon is a Widget instance which may be hidden, shown and observed and styled just like any other widget.
- expand : FieldTriggerConfig
Expands the date picker to select a date
- back : FieldTriggerConfig
Subtracts the step from the current date
- forward : FieldTriggerConfig
Adds the step to the current date
- clear : FieldTriggerConfig
Clears the field value, only available if this field is clearable
Has a corresponding runtime triggers property.
- expand : FieldTriggerConfig
-
Set to
trueto first clear time of the field's value before comparing it to the max value -
The week start day in the picker, 0 meaning Sunday, 6 meaning Saturday. Uses localized value per default.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of DateField class, or subclass thereof.
-
Identifies an object as an instance of DateField class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
changePicker( )internal
Creates default picker widget