fluent-ts-validator
Version:
A fluent validator written in TypeScript
22 lines • 582 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Validates if given date is same as or before than specified date.
*
* @export
* @class IsSameOrBeforeValidator
* @implements {PropertyValidator<Date>}
*/
class IsSameOrBeforeValidator {
constructor(date) {
this.date = date;
}
isValid(input) {
if (input) {
return input.getTime() <= this.date.getTime();
}
return false;
}
}
exports.IsSameOrBeforeValidator = IsSameOrBeforeValidator;
//# sourceMappingURL=IsSameOrBeforeValidator.js.map