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

View File

@@ -17,7 +17,7 @@ function addNavItem(title, icon, route) {
// on change of authentication status
export default function initialize() {
if (store.state.authenticated) {
//GET ALL DEFAULT LOCALIZED TEXT FOR SHELL
//Fetch the core localized text keys that will always be required by user
locale
.fetch(locale.coreKeys)
.then(function() {

View File

@@ -65,7 +65,8 @@ export default {
"WikiPage",
"Duplicate",
"RecordHistory",
"ErrorFieldLengthExceeded"
"ErrorFieldLengthExceeded",
"ErrorStartDateAfterEndDate"
],
decimalValidate(required) {
return { required: required, decimal: [2, this.formats.decimalSeparator] };