Class: DateTimeRangeValidator

Oracle® Fusion Middleware Oracle JavaScript Extension Toolkit (JET)
12c (12.1.4)

E54107-01

QuickNav

oj. DateTimeRangeValidator

Constructor

new DateTimeRangeValidator(options)

Constructs a DateTimeRangeValidator that ensures the value provided is within a given range
Parameters:
Name Type Argument Description
options Object <optional>
an object literal used to provide:

  • min: The minimum datetime value of the entered value.

  • max: The maximum datetime value of the entered value.

  • hint: an optional object literal of hint text to be used. There is no default hint provided by this validator.

    • 'hintMaximum': Hint message to be used, to give a hint about the allowed maximum.

      Parameters:

      • {max} the maximum

      Usage: Enter a datetime less than or equal to {max}

    • 'hintMinimum': Hint message to be used, to give a hint about the allowed minimum.

      Parameters:

      • {min} the minimum

      Usage: Enter a datetime greater than or equal to {min}

    • 'hintInRange': Hint message to be used, to give a hint about the allowed range.

      Parameters:

      • {min} the minimum
      • {max} the maximum

      Usage: Enter a datetime between {min} and {max}

  • message: an optional object literal of custom error messages to be used:

    • 'messageMaximum': The detail error message to be used when input value exceeds the maximum value set.

      Parameters:

      • {value} value entered by the user
      • {max} the maximum allowed value

      Usage: Entered {value} with max being {max}

    • 'messageMinimum': The detail error message to be used when input value is less than the set minimum value.

      Parameters:

      • {value} value entered by the user
      • {max} the minimum allowed value

      Usage: Entered {value} with min being {min}

    • 'messageNotInRange': The detail error message to be used if input value is not within the range, when minimum and maximum is set.

      Parameters:

      • {value} value entered by the user
      • {min} the minimum allowed value
      • {max} the maximum allowed value

      Usage: Entered {value} with min and max being {min}, {max}

Source:

Methods

getHint() → {String|null}

A message to be used as hint. There is no default hint for this property.
Source:
Returns:
a hint message or null if no hint is available in the options
Type
String | null

Init(options)

Initializes validator instance with the set options
Parameters:
Name Type Argument Description
options Object <optional>
Source:

validate(value) → {Object}

Validates the minimum + maximum conditions
Parameters:
Name Type Description
value Object that is being validated
Source:
Throws:
when there is no match
Type
Error
Returns:
original if validation was successful
Type
Object