-
Notifications
You must be signed in to change notification settings - Fork 6
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
[OF#3755] Datetime validation #636
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #636 +/- ##
==========================================
+ Coverage 73.04% 73.74% +0.69%
==========================================
Files 219 220 +1
Lines 4474 4498 +24
Branches 1186 1192 +6
==========================================
+ Hits 3268 3317 +49
+ Misses 1167 1142 -25
Partials 39 39 ☔ View full report in Codecov by Sentry. |
ca98e41
to
8a6bf59
Compare
If the datetime is entered with the keyboard instead of the widget, no validation was being performed. This adds the validation in the same way as for the date component (see open-formulieren/open-forms#3443)
8a6bf59
to
25589d3
Compare
src/formio/validators/utils.js
Outdated
return {isValid: true}; | ||
} | ||
|
||
const parsedValue = parseISO(value, 'yyyy-MM-dd', new Date()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the format be dependent on the componentType
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually doesn't seem to be used 🤔 parseIso
does not have a format argument 🤔 https://date-fns.org/v2.3.0/docs/parseISO#arguments
I will remove these extra args
434d7f6
to
eb4def7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to merge this after the 2.5.0 release, we can then release it as a bugfix for 2.5.1.
Fixes open-formulieren/open-forms#3755 (partially)