10 lines
258 B
JavaScript
10 lines
258 B
JavaScript
|
module.exports = Self => {
|
||
|
function rangeValid(err) {
|
||
|
if (this.from && this.to && this.from >= this.to)
|
||
|
err();
|
||
|
}
|
||
|
Self.validate('rangeValid', rangeValid, {
|
||
|
message: `Start date should be lower than end date`
|
||
|
});
|
||
|
};
|