# inputEx-library

### inputEx 0.5.1

inputEx-library > inputEx > inputEx.DateField
Search:
Filters Show Private Show Protected Show Deprecated

## Class inputEx.DateField - extends inputEx.StringField

Known Subclasses:
  inputEx.DatePickerField

A Date Field.

### Constructor

inputEx.DateField `( options )`

Parameters:
  `options <Object>` Add the folowing options:
  - dateFormat: Editor format (the one which is presented to the user) default to 'm/d/Y'
  - valueFormat: if falsy, the field will return a javascript Date instance. Otherwise, this format will be used for input parsing/output formatting

#### Properties inherited from inputEx.Field:

`options`

### Methods

#### formatDate

`void formatDate ( )`
Those methods are limited but largely enough for our usage

#### getValue

`String || Date getValue ( forceDate )`
Return the date

Parameters:
  `forceDate <Boolean>` Skip the valueFormat option if set to truthy

Returns: `String || Date`
  Formatted date using the valueFormat or a javascript Date instance

#### parseWithFormat

`void parseWithFormat ( )`
Those methods are limited but largely enough for our usage

#### setOptions

`void setOptions ( options )`
Adds the 'inputEx-DateField' default className

Parameters:
  `options <Object>` Options object as passed to the constructor

#### setValue

`void setValue ( val , [sendUpdatedEvt] )`
Format the date according to options.dateFormat

Parameters:
  `val <Date>` Date to set
  `[sendUpdatedEvt] <boolean>` (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event)

#### validate

`void validate ( )`
Specific Date validation depending of the 'format' option

#### Methods inherited from inputEx.Field:

`clear, close, destroy, disable, displayMessage, enable, fireUpdatedEvt, focus, getEl, getParentField, getState, getStateString, getValue, hide, initEvents, isDisabled, isEmpty, onBlur, onChange, onFocus, render, renderComponent, setClassFromState, setFieldName, setOptions, setParentField, setValue, show, validate`

#### Methods inherited from inputEx.StringField:

`disable, enable, focus, getStateString, getValue, initEvents, isDisabled, onFocus, renderComponent, setClassFromState, setFieldName, setOptions, setValue, validate`

#### Events inherited from inputEx.Field:

`updatedEvt,`

Copyright © 2010 Eric Abouaf All rights reserved.