-
Notifications
You must be signed in to change notification settings - Fork 181
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
Introduce a locale sensitive date-picker #746
Introduce a locale sensitive date-picker #746
Conversation
Early comments: React Spectrum's picker has a white (rgb(248, 248, 248)) background color which makes it look a little weird if the container doesn't explicitly define boundaries. Maybe we should use the same color as Carbon's? |
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.
Thanks for the nice work on this! A few things (this whole thing is a bit tricky), but hey.
...esm-styleguide/src/datepicker/react-spectrum/adobe-react-spectrum-date-wrapper.component.tsx
Outdated
Show resolved
Hide resolved
...esm-styleguide/src/datepicker/react-spectrum/adobe-react-spectrum-date-wrapper.component.tsx
Show resolved
Hide resolved
...esm-styleguide/src/datepicker/react-spectrum/adobe-react-spectrum-date-wrapper.component.tsx
Outdated
Show resolved
Hide resolved
packages/framework/esm-styleguide/src/datepicker/react-spectrum/locales.ts
Outdated
Show resolved
Hide resolved
I added @mogoodrich as a reviewer, as I know he is interested in this functionality. |
2e6772d
to
6953727
Compare
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.
I'm not familiar with this widget, so didn't do a full review, but please see my comments @samuelmale @ibacher @mseaton , especially the one about setting UTC date.
I think this is the last thing for this particular PR. We essentially just style the react-spectrum component so it looks exactly like the Carbon component. Otherwise, it will clash with the rest of the UI. Really nice work on this @samuelmale! |
@samuelmale thank you so much for working on this. @mseaton @ibacher @mogoodrich I agree and value everyone's comments and ideas shared for this PR but I have a special request: can we revert (temporarily) to the initial solution Samuel has proposed, of having the carbon date picker being returned if the timezone is English otherwise return the spectrum data picker. Am asking this because the Ethiopia Team needs this feature incorporated as soon as possible, they are rolling out O3 next week. They had initially forked everything but we managed to move them away from that. The plan is not to leave this as is but work on carbonizing the component as recommended. |
@ebambo I haven't been following this super closely, but I'm generally okay with doing something temporary in order for you to move forward, as long as there is a plan to move away from the temporary solution. Defer to @samuelmale and @ibacher on the specifics. |
@ebambo In principle, I think it's fine to integrate something like the earlier version. The comments Mark and I made specifically around date calculations will need to be fixed. It would also be important to swap the call to As long as those minimal changes are addressed and we have some assurance that changing from |
@ibacher @mogoodrich thank you so much for prompt response. @ibacher sure thing, we will address the points you raised and merge the PR. |
5b04af7
to
c535313
Compare
export const supportedLocales = { | ||
am: "Amharic", | ||
am_ET: "Amharic (Ethiopia)", | ||
ti_ET: "Tigrinya (Ethiopia)", | ||
}; |
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.
To minimize potential chaos, I have restricted this to locales specific to Ethiopia only.
Requirements
For changes to apps
If applicable
Summary
This PR basically introduces a locale-sensitive date-picker to the style-guide. So far it's a mix of Carbon and Adobe React Spectrum's (ARS) date-picker.
How does it work?
ARS' date-picker has more concrete support for Internationalization out of the box. The fact that it supports non-gregorian calendars was the most compelling factor for choosing this library. We simply render ARS's date-picker if the current locale is supported by ARS, otherwise, we default to Carbon's date-picker. Take note that all the "English" specific locales have been excluded from the ARS' supported locales.
What next?
Screenshots
Related Issue
N/A
Other
Resources
Shouts
Kudos to @sinteco for working on this