diff --git a/index.dev.html b/index.dev.html index 6b57e8eb..f93d3ae3 100644 --- a/index.dev.html +++ b/index.dev.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/index.html b/index.html index f93d3ae3..80dbcb37 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,6 @@ errRepURL: '' })); - + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ce8cb92f..676177c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-8", "license": "GNU AGPL v3.0", "dependencies": { "@caliorg/a2jdeps": "^7.1.7", diff --git a/package.json b/package.json index 9b970751..5489e81a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caliorg/a2jviewer", - "version": "8.2.0-1", + "version": "8.2.0-9", "description": "A2J Viewer standalone and preview app.", "main": "a2jviewer/app", "scripts": { diff --git a/src/mobile/pages/fields/field/field.js b/src/mobile/pages/fields/field/field.js index 112998cd..8c56dc4a 100644 --- a/src/mobile/pages/fields/field/field.js +++ b/src/mobile/pages/fields/field/field.js @@ -310,7 +310,38 @@ export const FieldVM = DefineMap.extend('FieldVM', { } else if (field.type === 'datemdy') { // format date to (mm/dd/yyyy) from acceptable inputs value = this.normalizeDateInput($el.val()) + + // date bounds are in 6 or 8 digit texts + // need to change to same format as value + // it would be sensible to keep bounds in this + // format but we need to support it to properly + // support older released guides without adding + // more complex code + + if (field.hasOwnProperty('max')) { + let maxDate = + field.max.substr(0, 2) + '/' + + field.max.substr(2, 2) + '/' + + field.max.substr(4) + + if (Date.parse(value) > Date.parse(maxDate)) { + value = maxDate + } + } + + if (field.hasOwnProperty('min')) { + let minDate = + field.min.substr(0, 2) + '/' + + field.min.substr(2, 2) + '/' + + field.min.substr(4) + + if (Date.parse(value) < Date.parse(minDate)) { + value = minDate + } + } + // render formatted date for end user + $el.val(value) } else { value = $el.val()