This commit is contained in:
2019-03-22 21:20:43 +00:00
parent 0774451be0
commit 7fc2e33f10
2 changed files with 15 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
/* Xeslint-disable */
/* eslint-disable */
///////////////////////////////
// GZVALIDATE
//
@@ -23,15 +23,8 @@ function isEmpty(o) {
//
function getControl(v, ref) {
var ctrl = v.$refs[ref];
if (errorHandler.developmentModeShowErrorsImmediately) {
if (isEmpty(ctrl)) {
throw "GZValidate:getControl - the control has no label " + ctrl;
}
} else {
if (isEmpty(ctrl)) {
return null;
}
}
return ctrl;
}
////////////////////////////////////
@@ -65,7 +58,7 @@ export default {
//
Required(v, ref) {
var ctrl = getControl(v, ref);
if (!ctrl) {
if(typeof ctrl == 'undefined'){
return false;
}
@@ -87,7 +80,7 @@ export default {
//
MaxLength(v, ref, max) {
var ctrl = getControl(v, ref);
if (!ctrl) {
if(typeof ctrl == 'undefined'){
return false;
}
@@ -148,32 +141,25 @@ export default {
// AFTER
After(v, refStart, refEnd) {
var ctrlStart = getControl(v, refStart);
if (!ctrlStart) {
if(typeof ctrlStart == 'undefined'){
return false;
}
var ctrlEnd = getControl(v, refEnd);
if (!ctrlEnd) {
if(typeof ctrlEnd == 'undefined'){
return false;
}
var valueStart = getControlValue(ctrlStart);
if (!isEmpty(valueStart)) {
if (isEmpty(valueStart)) {
return false;
}
var valueEnd = getControlValue(ctrlEnd);
if (!isEmpty(valueEnd)) {
if (isEmpty(valueEnd)) {
return false;
}
if (_.isEmpty(valueStart)) {
return false;
}
if (_.isEmpty(valueEnd)) {
return false;
}
valueStart = dayjs(valueStart);
valueEnd = dayjs(valueEnd);