This commit is contained in:
2019-03-11 23:04:29 +00:00
parent 1b0becca01
commit 263426a741
5 changed files with 31 additions and 2 deletions

View File

@@ -27,5 +27,30 @@ export default {
} else {
return false;
}
},
After(startDate, endDate) {
if (startDate === undefined || startDate === null) {
return false;
}
if (endDate === undefined || endDate === null) {
return false;
}
startDate = dayjs(startDate);
endDate = dayjs(endDate);
// if either is not valid.
if (!startDate || !endDate) {
return false;
}
if (startDate.isAfter(endDate)) {
// "ErrorStartDateAfterEndDate": "Start date must be earlier than stop / end date",
var err = locale.get("ErrorStartDateAfterEndDate");
return err;
} else {
return false;
}
}
};