Module: alfresco/forms/controls/DateTextBox

alfresco/forms/controls/DateTextBox

Creates a date-field input box. Can be preset to today's date by passing a value of "TODAY".
Author:
  • Dave Draper
License:
Source:

Example

Sample usage:

{
   name: "alfresco/forms/controls/DateTextBox",
   id: "VALID_DATE_VALUE_1",
   config: {
      name: "validDate1",
      value: "2012-12-12",
      label: "Valid date #1"
   }
}

Members

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/DateTextBox.css"}]
Source:

unsetReturnValue :object|string|null

The value to return when no date has been selected. By default this will return null, however some REST APIs may require an alternative value such as the empty string.
Type:
  • object | string | null
Since:
  • 1.0.85
Default Value:
  • undefined
Source:

valueFormatSelector :string

The selector to use for formatting a date. An alternative might be "datetime".
Type:
  • string
Since:
  • 1.0.84
Default Value:
  • "date"
Source:

Methods

configureValidation()

This function is used to set or update the validationConfig
Source:

createFormControl(config)

Create and return form control instance
Parameters:
Name Type Description
config object The configuration to use when instantiating the form control
Source:

customValidator(validationConfig)

Ensure value is a date
Parameters:
Name Type Description
validationConfig object The configuration for this validator
Source:

formControlValueChange(attributeName, oldValue, value)

Extends the inherited function to format the new date value correctly.
Parameters:
Name Type Description
attributeName string
oldValue object
value object
Since:
  • 1.0.84
Source:

getValue() → {object}

Get the value currently assigned to the wrapped widget
Source:
Returns:
The current value of the field
Type
object

getWidgetConfig() → {object}

Get the configuration for the wrapped widget
Source:
Returns:
The configuration for the form control
Type
object

postMixInProperties()

Run after properties mixed into instance
Source:

processDateValue(value) → {object}

Processes a value to apply date formatting as necessary.
Parameters:
Name Type Description
value object The value to process
Since:
  • 1.0.91
Source:
Returns:
The processed value
Type
object