-
Notifications
You must be signed in to change notification settings - Fork 202
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
Add dates plugin #387
Add dates plugin #387
Conversation
🦋 Changeset detectedLatest commit: 2616ba4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2616ba4:
|
Hey @alex-streza thanks for this! Finally had the time to have a look at it. I see that you're calling |
Hey @dbismut, indeed your solution is much simpler yet effective for localization. I tested it and works flawlessly until date picking due to those 2 react-datepicker issues:
My workaround was adding an inputFormat setting so you can customize the date-picker input as you please and use the locale way you suggested for the formattedDate. I also updated size-limit since I couldn't run it on Windows with the previous config. |
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.
Hey @alex-streza thanks for the quick fix! I just have one little comment and then we're good to go.
Folowing suggestion #382 I've implemented a dates plugin, I can't decide whether it's an overkill to add a custom date-fns + react-datepicker implementation when this can also be achieved with a custom plugin (I could add better docs there too).
I took a look around and tweakpane doesn't have an official date plugin either, likely due to complexity, bundle size and lack of real use cases.
After a bit of tinkering I ended up with the following benchmarks through size-limit,
Before plugin-dates:
After plugin-dates: