Skip to content

Commit

Permalink
parse min and max only in comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasnteireho committed Feb 14, 2024
1 parent c2b0b65 commit 2170b5a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/mobile/pages/fields/field/field.js
Expand Up @@ -320,22 +320,22 @@ export const FieldVM = DefineMap.extend('FieldVM', {



let maxDate = Date.parse(
let maxDate =
field.max.substr(0,2) + "/" +
field.max.substr(2,2) + "/" +
field.max.substr(4))
field.max.substr(4)

let minDate = Date.parse(
let minDate =
field.min.substr(0,2) + "/" +
field.min.substr(2,2) + "/" +
field.min.substr(4))
field.min.substr(4)



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

0 comments on commit 2170b5a

Please sign in to comment.