Class

DateTimePickerRangeFieldPresets

DateTimePickerRangeFieldPresets()

Allows to select one date range from a list of presets or to select the range.

Constructor

# new DateTimePickerRangeFieldPresets()

Parameters:
Name Type Description
props.id

id of the DOM container

props.choices

selectable choices, a map of string : dateRange pairs

props.timepicker

if true the user can select hours and minutes

props.apply

callback that will be called whenever the state of the component is changed

props.dataNode

data node

View Source fields/DateTimePickerRangeFieldPresets.js, line 14

Extends

Methods

# addListeners()

Listener for on change properties By default is change event for a Input[type=text] field

Overrides:

View Source fields/BaseField.js, line 128

# buildDOM()

Builds the DOM representation (view) on initialization

Overrides:

View Source fields/DateTimePickerRangeFieldPresets.js, line 124

# getChoiceFromDateRange(dateRange) → {string|null}

Finds a choice in the choice picker that is nearly similar to the passed dateRange

Parameters:
Name Type Description
dateRange Object

View Source fields/DateTimePickerRangeFieldPresets.js, line 154

choice id or null

string | null

# getCleanId() → {String}

Get the clean id name (without # or .)

Overrides:

View Source fields/BaseField.js, line 161

Clean id

String

# getValue() → {*}

Get the current value of the field

Overrides:

View Source fields/BaseField.js, line 153

Value of the field

*

# refresh()

Updates the from and to dates to the current moment

View Source fields/DateTimePickerRangeFieldPresets.js, line 172

# restore()

Restore the previous value & trigger onChange callback

Overrides:

View Source fields/BaseField.js, line 196

# save()

Save action trigger onSave method

Overrides:

View Source fields/BaseField.js, line 188

# setDefault()

Set default value (Normally only in the constructor)

Overrides:

View Source fields/BaseField.js, line 110

# setDOM()

Updates the component view / DOM representation on state change

Overrides:

View Source fields/DateTimePickerRangeFieldPresets.js, line 119

# setElement()

Set the element to listen on changes Overload in some cases

Overrides:

View Source fields/BaseField.js, line 120

# setValue(value)

Set the value to the component

Parameters:
Name Type Description
value Object | String

Value of the component, dates object or string

Overrides:

View Source fields/DateTimePickerRangeFieldPresets.js, line 72