Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

255 date min max #263

Merged
merged 10 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
errRepURL: ''
}));
</script>
<script src="node_modules/steal/steal.production.js?v=1677170402416" cache-key="v" cache-version="1677170402416" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1697489872534" cache-key="v" cache-version="1697489872534" main="@caliorg/a2jviewer/app"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
errRepURL: ''
}));
</script>
<script src="node_modules/steal/steal.production.js?v=1697489872534" cache-key="v" cache-version="1697489872534" main="@caliorg/a2jviewer/app"></script>
<script src="node_modules/steal/steal.production.js?v=1708045473865" cache-key="v" cache-version="1708045473865" main="@caliorg/a2jviewer/app"></script>
</body>
</html>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
31 changes: 31 additions & 0 deletions src/mobile/pages/fields/field/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading