v7.3.0

DateField
Widget

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.

No results

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, forward and back triggers 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, and unit, a String

    Has a corresponding runtime step property.

  • Set to false to hide the forward and backward date step triggers. These triggers are only shown when step is set.

  • 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.

    Has a corresponding runtime triggers property.

  • Set to true to first clear time of the field's value before comparing it to the max value

  • Value, which can be a Date or a string. If a string is specified, it will be converted using the specified format

    Has a corresponding runtime value property.

  • 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
  • Get / set format for date displayed in field (see format for formatting options).

    Has a corresponding format config.

  • Get/set max value, which can be a Date or a string. If a string is specified, it will be converted using the specified format.

    Has a corresponding max config.

  • Get/set min value, which can be a Date or a string. If a string is specified, it will be converted using the specified format.

    Has a corresponding min config.

  • Get/set value, which can be set as a Date or a string but always returns a Date. If a string is specified, it will be converted using the specified format

    Has a corresponding value config.

  • isDateField : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of DateField class, or subclass thereof.

Functions

Functions are methods available for calling on the class

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class
    type: datefield

    Source path

    Core/widget/DateField.js

    Contents