# Class: Date

## jala.Form.Component.Date(name)

Subclass of jala.Form.Component.Input which renders and validates a date editor.

## Constructor

#### new Date(name)

Constructs a new Date component instance

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | String | Name of the component, used as name of the html controls.

Source:
  - jala/code/Form.js, line 1824

##### Returns:

A newly created Date component

### Methods

#### checkRequirements(reqData)

Validates user input from a date editor.

##### Parameters:

Name | Type | Description
--- | --- | ---
`reqData` | Object | request data

Source:
  - jala/code/Form.js, line 1882

##### Returns:

null if everything is ok or string containing error message

#### getDateFormat()

Returns the date format for this component.

Source:
  - jala/code/Form.js, line 1835

##### Returns:

date format object

#### parseValue(reqData)

Parses the string input from the form and converts it to a date object. Throws an error if the string cannot be parsed.

##### Parameters:

Name | Type | Description
--- | --- | ---
`reqData` | Object | request data

Source:
  - jala/code/Form.js, line 1898

##### Returns:

parsed date value

#### renderControls(attr, value, reqData)

Renders a textarea tag to the response.

##### Parameters:

Name | Type | Description
--- | --- | ---
`attr` | Object | Basic attributes for this element.
`value` | Object | Value to be used for rendering this element.
`reqData` | Object | Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured.

Source:
  - jala/code/Form.js, line 1863

#### setDateFormat(newDateFormat)

Sets the date format for this component.

##### Parameters:

Name | Type | Description
--- | --- | ---
`newDateFormat` | String | new date format

Source:
  - jala/code/Form.js, line 1846