-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactor: Added support for string-based property values for date based components #1470
Conversation
…ed components This commit adds support for passing in string based date values to date-bound properties of calendar, date-time input and date picker components. The component will now try to parse the passed in value without directly throwing an exception. Unified the type declarations between date-bound component.
Added tests for date-time input. The date utilities class uses the new parse ISO implementation which returns `null` instead of `Invalid date` for certain time portions. Adjusted the tests accordingly. This means that the date-time input additional checks around the mask value logic could be simplified but that is for another PR.
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.
Should probably plan to revise the date utils down the line, now that some of the parsing is shared with the calendar. Other than that, LGTM :)
@Marina-L-Stoyanova Just to check - have you tested this change in some more complete scenario than the repo sample for the issue? As in some of the AB form scenarios - asking specifically because we discussed the code produced for nullable variables or request-bound would produce optional values, see #1470 (comment) and with the latest version those would result in type check errors: |
Yes, everything looks ok. I have tested it with form application that has date picker inputs. I installed the suggested plugin and it is working as expected. |
This commit adds support for passing in string based date values to date-bound properties of calendar, date-time input and date picker components. The component will now try to parse the passed in value without directly throwing an exception.
Unified the type declarations between date-bound component.
Closes #1467