ep.validate.date()
Categories: Utilities
ep.validate.date( value, [ options ] )
Plugin: ep.validate
Description: Validate a date.
-
ep.validate.date( value, [ options ] )
version added: 6.11.0value A text to validate
options A map of additional options pass to the method.
The ep.validate.date()
method checks if the givn string an valid date.
-
Validate a date.
Code:
ep.validate.date( '01.02.2011', {format: 'd', region: 'de'} );
Results:
true
-
Validate a date with error return.
Code:
ep.validate.date( '01/02/2011', {format: 'd', region: 'de'} );
Results:
NO_DATE
ep.validate.number( value, [ options ] )
Plugin: ep.validate
Description: Validate a date.
-
ep.validate.number( value, [ options ] )
version added: 6.11.0value A text to validate
options A map of additional options pass to the method.
The ep.validate.number()
method checks if the givn string an valid number.
-
Validate a number.
Code:
ep.validate.date( '12,50', {format: 'n', region: 'de'} );
Results:
true
-
Validate a percent number.
Code:
ep.validate.date( '12,50 %', {format: 'p2', region: 'de'} );
Results:
true
-
Validate a number with error return.
Code:
ep.validate.date( '12.50', {format: 'n', region: 'de'} );
Results:
NO_NUMBER