v7.3.0

DateRangeField
Widget

A compound field for editing a start/end date pair. The two Date values are stored together in the value property as an object with startDate and endDate keys. A dropdown picker with dual month calendars lets the user select the range visually. By default the picker edits the value live; enable confirmable to require explicit OK/Cancel confirmation. Clicking or arrow-keying in the picker adjusts whichever date field currently has focus. Calendar cells can be customized via cellRenderer.

By default, the picker displays below the fields and edits the value "live":

The confirmable config instructs the picker to display on top of the field with OK and Cancel buttons:

const dateRange = new DateRangeField({
    label : 'Project dates',
    value : {
        startDate : new Date(2025, 0, 1),
        endDate   : new Date(2025, 5, 30)
    },
    appendTo : document.body
});

Useful configs and properties

Config Description
value An object with startDate and endDate properties
confirmable Show OK/Cancel buttons on the picker
picker Configuration for the date range picker dropdown

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Max value

    Has a corresponding runtime max property.

  • Min value

    Has a corresponding runtime min property.

  • pickTime : Booleanfalse
    internal

    Set to true to include time fields to allow the user to pick the time of day. When this config is set, keepTime is no longer used.

  • pickerCls : String
    internal

    An optional extra CSS class to add to the picker container element.

    Has a corresponding runtime pickerCls 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

CSS variables

CSS variables that can be set to adjust appearance
Name Description
--b-date-range-field-gap Gap between the start and end date fields
type: daterangefield

Source path

Core/widget/DateRangeField.js

Contents