v1.1.0
New tests added:
time
Checks if the value is a valid string representing time in a 24 hour format (hh:mm:ss).
Parameters: none
Result: default
Message: '{title} is not a valid time'
Example:
var rule = {
time: true
};
var result = approve.value('12:25:30', rule);date
Checks if the value is a valid string representing a date (YYYY[/-]MM[-/]DD).
Parameters: none
Result: default
Message: '{title} is not a valid date'
Example:
var rule = {
date: true
};
var result = approve.value('2016-10-01', rule);truthy
Checks if the value is truthy ('Yes', '1', 'true', 'ok[ay]').
Parameters: none
Result: default
Message: '{title} is not valid'
Example:
var rule = {
truthy: true
};
var result = approve.value('Yes', rule);falsy
Checks if the value is not truthy ('No', '0', 'false').
Parameters: none
Result: default
Message: '{title} is not valid'
Example:
var rule = {
falsy: true
};
var result = approve.value('No', rule);