@optimiser/common 1.0.301 → 1.0.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/utility.js +4 -1
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -4571,6 +4571,9 @@ function ValidateUserInput(options) {
|
|
|
4571
4571
|
}
|
|
4572
4572
|
field = schemaFields.find(function (x) { return x.Name == fieldName; });
|
|
4573
4573
|
if (!field) return [3 /*break*/, 52];
|
|
4574
|
+
if ((field.UIDataType == 'date' || field.UIDataType == 'datetime') && IsStringValue(fieldData) && fieldData.trim() == '') {
|
|
4575
|
+
inputFields[fieldName] = null;
|
|
4576
|
+
}
|
|
4574
4577
|
if (fieldData && IsStringValue(fieldData) && field.UIDataType != 'dropdown') {
|
|
4575
4578
|
fieldData = fieldData.trim();
|
|
4576
4579
|
if (["text", "email", "phone"].includes(field.UIDataType)) {
|
|
@@ -4662,7 +4665,7 @@ function ValidateUserInput(options) {
|
|
|
4662
4665
|
{
|
|
4663
4666
|
filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
4664
4667
|
if (!filter.test(fieldData)) {
|
|
4665
|
-
msg = '
|
|
4668
|
+
msg = fieldData + ' is invalid email for ' + field.DisplayName + '!';
|
|
4666
4669
|
}
|
|
4667
4670
|
}
|
|
4668
4671
|
return [3 /*break*/, 51];
|