Skip to content
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

Merged
merged 4 commits into from
Apr 20, 2024

Conversation

blm768
Copy link
Contributor

@blm768 blm768 commented Apr 2, 2024

Fixes #881

Proposed Changes

  • Accept plain dates in onChange, not just date-range pairs

Note that parsing of date ranges is still broken; it collapses them to a single date.
That seems like a separate bug, though.

Copy link

netlify bot commented Apr 2, 2024

Deploy Preview for oruga-documentation-preview ready!

Name Link
🔨 Latest commit 8712a04
🔍 Latest deploy log https://app.netlify.com/sites/oruga-documentation-preview/deploys/661eaf0f5f93bc000822f484
😎 Deploy Preview https://deploy-preview-882--oruga-documentation-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 21.94%. Comparing base (484cfe8) to head (8712a04).
Report is 46 commits behind head on develop.

Files Patch % Lines
...ges/oruga/src/components/datepicker/Datepicker.vue 57.14% 3 Missing ⚠️
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     
Flag Coverage Δ
oruga-next 21.94% <57.14%> (-34.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mlmoravek mlmoravek added the bug Something isn't working label Apr 9, 2024
@blm768
Copy link
Contributor Author

blm768 commented Apr 10, 2024

Just force-pushed with some commits that aren't signed with the wrong PGP key.

Copy link
Member

@mlmoravek mlmoravek left a 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 =>
Copy link
Member

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 ?

@mlmoravek
Copy link
Member

@blm768 I appreciate that you are adding tests related to the bug! :)

@blm768
Copy link
Contributor Author

blm768 commented Apr 16, 2024

@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 @vue/test-utils; I need to start using that with my own Vue projects.

@mlmoravek mlmoravek merged commit 047e999 into oruga-ui:develop Apr 20, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Datepicker component no longer editable
2 participants