How to do multiple forward method? #1140
Unanswered
jame-earnin
asked this question in
Q&A
Replies: 2 comments
-
I did add console.log const schema = pipe(
object({
dates: object({ start: any(), end: any() }), // TODO:
type: picklist(TYPES.map((type) => type.value)),
hours: picklist(HOURS.map((h) => h.value)), // TODO:
timeFrame: picklist(TIME_FRAMES.map((h) => h.value)), // TODO:
startTime: any(), //optional(string()), // TODO:
endTime: any(), //optional(string()), // TODO:
note: string(), // TODO:
}),
forward(
partialCheck(
[['startTime'], ['endTime']],
(input) => {
if (!input.startTime || !input.endTime) {
return true
}
console.log('input endTime', input) // <---
return parseAMPMTime(input.endTime) > parseAMPMTime(input.startTime)
},
'End time must be after start time',
),
['endTime'],
),
forward(
partialCheck(
[['startTime'], ['endTime']],
(input) => {
if (!input.startTime || !input.endTime) {
return true
}
console.log('input startTime', input) // <---
return parseAMPMTime(input.endTime) > parseAMPMTime(input.startTime)
},
'End time must be after start time',
),
['startTime'],
),
) it does not log |
Beta Was this translation helpful? Give feedback.
0 replies
-
How does your react-hook-form setup looks like? Does it validate all fields, or no? Because, by default it's |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How to do multiple forward method?
I use with react-hooks-form. It does not trigger the error with the
startTime
.Beta Was this translation helpful? Give feedback.
All reactions