[intro]     [up]

Class DateMask

Extends Class: InputMask

A mask for dates.
Is uses a DateParser to format the data. A single parser may (and should!) be used for multiple mask instances.

Example
//Assume there is a input on the document
var parser = new DateParser("dd/MM/yyyy");
new DateMask(parser, "date");


Constructor Arguments
Name Type Default Description
parser DateParser   The DateParser used to parse/format/validate data
control HTML Input   The input to mask
validate boolean The value of the JST_DEFAULT_DATE_MASK_VALIDATE constant Will this mask validate the typed text?
validationMessage String The value of the JST_DEFAULT_DATE_MASK_VALIDATION_MESSAGE constant The message to be shown when a validation error occours. If empty, will not alert the user. The ${value} placeholder may be used as a substituition for the field value, and ${mask} for the parser mask
keyPressFunction Function null Callback function for the keypress event
keyDownFunction Function null Callback function for the keydown event
keyUpFunction Function null Callback function for the keyup event
blurFunction Function null Callback function for the blur event
updateFunction Function null Callback function called whenever the mask is applied. The mask reference is passed on the call

Properties
blurFunction Callback function for the blur event
control The input to mask
keyDownFunction Callback function for the keydown event
keyPressFunction Callback function for the keypress event
keyUpFunction Callback function for the keyup event
parser The DateParser used to parse/format/validate data
updateFunction Callback function called whenever the mask is applied
validate Will this mask validate the typed text?
validationMessage The message to be shown when a validation error occours

Methods
getAsDate Returns the control value as a Date
setAsDate Sets the control value as a Date
update Forces the mask to be applied on the control



Properties
blurFunction
Callback function for the blur event
control
The input to mask
keyDownFunction
Callback function for the keydown event
keyPressFunction
Callback function for the keypress event
keyUpFunction
Callback function for the keyup event
parser
The DateParser used to parse/format/validate data
updateFunction
Callback function called whenever the mask is applied. The mask reference is passed on the call
validate
Will this mask validate the typed text?
validationMessage
The message to be shown when a validation error occours. If empty, will not alert the user. The ${value} placeholder may be used as a substituition for the field value, and ${mask} for the parser mask





Methods
 
getAsDate
Returns the control value as a Date
 
setAsDate
Sets the control value as a Date
Arguments
Name Type Default Description
number Date   The value as a Date
 
update
Forces the mask to be applied on the control