-
Notifications
You must be signed in to change notification settings - Fork 173
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
fix(datepicker): make date parsing work again #882
Conversation
✅ Deploy Preview for oruga-documentation-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #882 +/- ##
============================================
- Coverage 56.71% 21.94% -34.78%
============================================
Files 30 110 +80
Lines 1511 5281 +3770
Branches 544 1943 +1399
============================================
+ Hits 857 1159 +302
- Misses 654 3282 +2628
- Partials 0 840 +840
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
59e44b2
to
89fbefd
Compare
Just force-pushed with some commits that aren't signed with the wrong PGP key. |
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.
Maybe we should also change the default value of readonly
to false
instead of true? What do you think?
@@ -852,13 +852,15 @@ function formatNative(value: Date | Date[]): string { | |||
/** Parse string into date */ | |||
function onChange(value: string): void { | |||
const date = (props.dateParser as any)(value, defaultDateParser); | |||
const validDate = (d: unknown): d is 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.
What do you think about moving this to utils/helper.ts
and name it isDate
like the existing helper isObject
?
@blm768 I appreciate that you are adding tests related to the bug! :) |
You're welcome. It was a good chance for me to learn how to use |
Fixes #881
Proposed Changes
onChange
, not just date-range pairsNote that parsing of date ranges is still broken; it collapses them to a single date.
That seems like a separate bug, though.