Skip to content

Commit

Permalink
Merge pull request #24 from bcgov/medis-imp-export-api-fe-valid
Browse files Browse the repository at this point in the history
Test:Date filed format issue
  • Loading branch information
evgeny-pluzhnikov authored Aug 9, 2023
2 parents d1e02db + e216e40 commit bdc453f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
6 changes: 4 additions & 2 deletions app/frontend/src/components/designer/FormViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -662,14 +662,16 @@ export default {
case 'custom':
if (obj.component.validate.custom.length) {
validatorIdentity +=
'|custom:' + obj.component.validate[validity].trim();
'|custom:' +
obj.component.validate[validity].trim().replaceAll(',', ';');
}
break;
case 'customMessage':
if (obj.component.validate.customMessage) {
validatorIdentity +=
'|customMessage:' + obj.component.validate[validity].trim();
'|customMessage:' +
obj.component.validate[validity].trim().replaceAll(',', ';');
}
break;
Expand Down
42 changes: 15 additions & 27 deletions app/frontend/src/components/designer/FormViewerMultiUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -336,43 +336,31 @@ export default {
case 'simpledatetimeadvanced':
component.validate.custom =
"if(component.validate.required === true){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong DateTime format. (Example:" +
component.format +
")' : true;} else if(input){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong DateTime format. (Example:" +
component.format +
")' : true;}" +
"if(component.validate.required === true){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong DateTime format.';} else if(input){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong DateTime format.';}" +
component.validate.custom;
break;
case 'simpledatetime':
component.validate.custom =
"if(component.validate.required === true){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong Date/Time format. (Example:" +
component.format +
")' : true;}else if(input){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong Date/Time format. (Example:" +
component.format +
')' +
"if(component.validate.required === true){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong Date/Time format.';} else if(input){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong Date/Time format.';}" +
component.validate.custom;
break;
case 'simpletimeadvanced':
component.validate.custom =
"if(component.validate.required === true){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong Time format. (Example:" +
component.format +
")' : true;}else if(input){valid = moment(input).format('" +
component.format +
"') === 'Invalid date' ? 'Wrong Time format. (Example:" +
component.format +
")' : true;}" +
"if(component.validate.required === true){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong Time format.';} else if(input){valid = moment(input, _.replace('" +
component.widget.format +
"','dd','DD'), true).isValid() === true ? true : 'Wrong Time format.';}" +
component.validate.custom;
break;
Expand Down

0 comments on commit bdc453f

Please sign in to comment.