salix/modules/agency/back/models/zone-event.js

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`
});
};