# Class DatePicker

A date picker widget with standard styling.

## Index

### Methods

- build
- getDateValue
- getElement
- getValue
- reset
- setValue

### Constructors

- constructor

## Methods

### build

- build(): HTMLInputElement

- - Defined in ui/FormWidgets/DatePicker.ts :91

  Gets the element on which the date picker is bound.

  #### Returns HTMLInputElement

  The date picker element.

### getDateValue

- getDateValue(): Date

- - Defined in ui/FormWidgets/DatePicker.ts :68

  Get the currently selected value in the date picker, as a Date object

  #### Returns Date

  A Date object for the current value, or null if the date picker was reset or a date has not been selected initially.

### getElement

- getElement(): HTMLInputElement

- - Defined in ui/FormWidgets/DatePicker.ts :48

  Gets the element on which the date picker is bound.

  #### Returns HTMLInputElement

  The date picker element.

### getValue

- getValue(): string

- - Defined in ui/FormWidgets/DatePicker.ts :56

  Gets the currently selected value in the date picker.

  #### Returns string

  A textual representation of the currently selected value (`YYYY-MM-DD` format).

### reset

- reset(): void

- - Defined in ui/FormWidgets/DatePicker.ts :38

  Resets the date picker.

  #### Returns void

### setValue

- setValue(date: Date): void

- - Defined in ui/FormWidgets/DatePicker.ts :80

  Sets the date picker value.

  #### Parameters

  - ##### date: Date

    The value to set the date picker to. Must be a Date object.

  #### Returns void

## Constructors

### constructor

- new DatePicker(onChange?: function): DatePicker

- - Defined in ui/FormWidgets/DatePicker.ts :23

  Creates a new `DatePicker`.

  #### Parameters

  - ##### Default value onChange: function = () => {}

    The function to call when a new value is selected in the date picker. This function takes the current `DatePicker` instance as an argument.

    - - (datePicker: DatePicker): void

      - #### Parameters

        - ##### datePicker: DatePicker

        #### Returns void

  #### Returns DatePicker

### Hierarchy

- DatePicker

### Implements

- IFormWidget
- IFormWidgetSettable