You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But that's a question: How can i get resolved value of reference ? In this case i expect to get somehow (not through render of error message or through error.local and ancestors hack) value of dateTo : new Date('2023-10-25').
Why do i need this: on client im taking limit value from error details context to format it and apply as localised value. (parsing through date-fns library becomes as Invalid Date cause of limit: {} - ref object, not a date value of reference.
I have forked repo to workaround and can fix my requirement by add extra field in the date base rule 'compare' like:
compare: {method: false,validate(value,helpers,{ date },{ name, operator, args }){constto=date==='now' ? Date.now() : date.getTime();if(Common.compare(value.getTime(),to,operator)){returnvalue;}// Adding extra property 'refValue' herereturnhelpers.error('date.'+name,{limit: args.date, value,refValue: to});},args: [{name: 'date',ref: true,normalize: (date)=>{returndate==='now' ? date : internals.parse(date);},assert: (date)=>date!==null,message: 'must have a valid date format'}]},
Also, i need to fix ±25 tests with such changes.
The text was updated successfully, but these errors were encountered:
you have added lot of details to analyse, but I am not getting the exact output you are expecting here, so you are asking to get error to be more conscience in the user perspective?
Context
How can we help?
Hello, a little question. Im using schema like:
As expected it results with error like:
But that's a question: How can i get resolved value of reference ? In this case i expect to get somehow (not through render of error message or through error.local and ancestors hack) value of dateTo : new Date('2023-10-25').
Why do i need this: on client im taking
limit
value from error details context to format it and apply as localised value. (parsing through date-fns library becomes as Invalid Date cause of limit: {} - ref object, not a date value of reference.I have forked repo to workaround and can fix my requirement by add extra field in the date base rule 'compare' like:
Also, i need to fix ±25 tests with such changes.
The text was updated successfully, but these errors were encountered: