Skip to content

Commit

Permalink
check max
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasnteireho committed Feb 13, 2024
1 parent 690b64e commit 9a3ce25
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/mobile/pages/fields/field/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,19 @@ export const FieldVM = DefineMap.extend('FieldVM', {

// format date to (mm/dd/yyyy) from acceptable inputs
value = this.normalizeDateInput($el.val())
// render formatted date for end user

console.log("changed")


if (Date.parse(value) < Date.parse(field.min)){
console.log("smaller")
value = field.min
} else if (Date.parse(value) > Date.parse(field.max)){
value = field.min
console.log("bigger")
value = field.max
}


// render formatted date for end user

$el.val(value)
} else {
Expand Down

0 comments on commit 9a3ce25

Please sign in to comment.