-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Create <Time/> component #5481
Comments
What do you thinks about using formattedDate ? |
Could you elaborate? |
We don’t actually need a time commponent because react-intl furnish one in formattedDate we just need to intput date and nothing else because there are an intlProvider |
The implementation we're working on does not replace While we could use However, what you mentioned isn't entirely accurate because we're not duplicating If you refer to the documentation of
This aligns perfectly with our approach. While you could argue for using |
A good point for react-intl is that we don't have to maintain it. It's an api of the package |
We neither need to maintain Using |
Create a generic
Time
cimponent that displays date info in the curent locale.The component should have two props:
date
, which should be a string orDate
object and the second one. corresponding to the shape of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#optionsThe component should return a
time
element, with the DateTime formatted on the currently applied locale (so the component must useuseLocale
hook).See the repeated usage of a workaround from #5479. The new component would replace these.
The text was updated successfully, but these errors were encountered: