Constructor
new DateTimeRangeValidatorFactory()
a factory implementation to create an instance of the built-in dateTimeRange validator of type
oj.DateTimeRangeValidator.
- Source:
- ojvalidation/ValidationFactoryImpl.js, line 187
Example
create an instance of the dateTimeRange validator using the factory
var drvf = oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_DATETIMERANGE);
var birthdateOptions = {min: new Date(1930, 00, 01), max: new Date(1995, 11,31)};
var birthdateValidator = drvf.createValidator(birthdateOptions);
Methods
-
<static> createValidator(options) → {oj.DateTimeRangeValidator}
-
Creates an immutable validator instance of type oj.DateTimeRangeValidator that ensures that the (datetime) value provided is within a given range.
Parameters:
Name Type Argument Description options
Object <optional>
an object literal used to provide the minimum, maximum and other optional values. See oj.DateTimeRangeValidator for details. - Source:
- ojvalidation/ValidationFactoryImpl.js, line 220
Returns: