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

feat: configurable DateRange presets #1924

Closed
wants to merge 3 commits into from

Conversation

AyushAgrawal-A2
Copy link
Contributor

@AyushAgrawal-A2 AyushAgrawal-A2 commented Apr 20, 2024

Description

closes #1855
closes #1909

Changes:

  • Added presetsFn prop in DateRange component. This is callback function to generate custom presets.
  • Added a subsection for presetsFn in Docs. Docs Link
  • Corrected PropListing's defaultValue prop name in docs.
  • Added test case in example project for testing.

Checklist

  • For UI or styling changes, I have added a screenshot or gif showing before & after
  • I have added a changeset
  • I have added to the docs where applicable
  • I have added to the VS Code extension where applicable

Copy link

changeset-bot bot commented Apr 20, 2024

🦋 Changeset detected

Latest commit: 3cd1ad3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@evidence-dev/core-components Minor
my-evidence-project Minor
@evidence-dev/components Minor
@evidence-dev/evidence Major
evidence-test-environment Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Apr 20, 2024

Deploy Preview for next-docs-evidence ready!

Name Link
🔨 Latest commit 3cd1ad3
🔍 Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/662450732f47fd000854bdfe
😎 Deploy Preview https://deploy-preview-1924--next-docs-evidence.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

netlify bot commented Apr 20, 2024

Deploy Preview for evidence-development-workspace ready!

Name Link
🔨 Latest commit 3cd1ad3
🔍 Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/66245073d955160008ef0ec3
😎 Deploy Preview https://deploy-preview-1924--evidence-development-workspace.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.

@mcrascal
Copy link
Member

mcrascal commented May 8, 2024

Hey @AyushAgrawal-A2 thanks for this, after looking at some of the other requests coming in around the date picker, my preference is to do something string based, rather than exposing the underlying date functions themselves.

I think with a large list of presets, the option to exclude presets, the option to set a default, and potentially options for start and end dates we'll be able to cover most cases, and keep the API consistent with the mostly string based options we have in other components.

E.g. excludes={['7 Days', '14 Days']}, default='Year to Date'

I'm going to close this for now.

@mcrascal mcrascal closed this May 8, 2024
@AyushAgrawal-A2 AyushAgrawal-A2 deleted the ayush/1855 branch May 8, 2024 14:52
@AyushAgrawal-A2
Copy link
Contributor Author

@mcrascal
I realised without discussion, I will not achieve the best implementation which is in line with the product.
I may have made similar mistakes in other PRs as well, sorry for wasting your time and thanks for reviewing my PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs show incorrect syntax for hideDuringPrint Configurable DateRange Presets
2 participants