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

Enable passing formatStyle to Intl.DateTimeFormat #260

Open
erlandsona opened this issue Jun 12, 2023 · 1 comment
Open

Enable passing formatStyle to Intl.DateTimeFormat #260

erlandsona opened this issue Jun 12, 2023 · 1 comment

Comments

@erlandsona
Copy link

Here A style argument is being passed to the config of the Intl.RelativeTimeFormat constructor.

But Here There's no way to configure the timeStyle or dateStyle properties as described in the MDN docs below:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#using_timestyle_and_datestyle

We have a use case where for DateTime's fitting within the users "today" we only want to display the timeStyle: 'short', but for DateTimes after today we only want to display the dateStyle: 'short' and with the current api I'm not sure how exactly to go about that 🤔

@keithamus
Copy link
Member

A PR adding attributes+props for timeStyle/dateStyle would be welcome.

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

No branches or pull requests

2 participants