Class M.DateValidator
Extends
M.Validator.
Validates a given date. Validates whether it is possible to create a M.Date (then valid) or not (then invalid).
Defined in: date_validator.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
A RegEx describing a german date.
|
|
A RegEx describing a US date.
|
|
The type of this object.
|
- Fields borrowed from class M.Validator:
- validationErrors
Method Attributes | Method Name and Description |
---|---|
validate(obj, key)
Validation method.
|
- Methods borrowed from class M.Validator:
- clearErrorBuffer, customize
- Methods borrowed from class M.Object:
- bindToCaller, create, destroy, extend, get, include, set
Field Detail
{Function (actually a RegEx)}
patternDateDE
A RegEx describing a german date.
Used for validation.
{Function (actually a RegEx)}
patternDateUS
A RegEx describing a US date.
Used for validation.
{String}
type
The type of this object.
Method Detail
{Boolean}
validate(obj, key)
Validation method. First checks if value is not null, undefined or an empty string and then tries to create a M.Date with it.
Pushes different validation errors depending on where the validator is used: in the view or in the model.
- Parameters:
- {Object} obj
- Parameter object. Contains the value to be validated, the M.ModelAttribute object of the property and the model record's id.
- key
- Returns:
- {Boolean} Indicating whether validation passed (YES|true) or not (NO|false).