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

Support for Intl.DurationFormat #2049

Open
3 tasks done
Ericlm opened this issue Dec 13, 2024 · 0 comments
Open
3 tasks done

Support for Intl.DurationFormat #2049

Ericlm opened this issue Dec 13, 2024 · 0 comments
Labels
Status: Proposal Request for comments

Comments

@Ericlm
Copy link

Ericlm commented Dec 13, 2024

Clear and concise description of the problem

Currently, vue-i18n supports number formatting and datetime formatting with $n and $d. It would be great if it could also support Intl DurationFormat.

Suggested solution

I think a new function would be needed ($n for numbers, $d for datetime, maybe $u (dUration)) or $du ? This function could be just like number or datetime formats, with formats for each language, and a default that would be the one of Intl.

Alternative

For now, I'm using NumberFormat as it is the way duration works anyway, but that would be cool if it was supported in vuei18n.

Additional context

https://moment.github.io/luxon/api-docs/index.html#durationtohuman (which uses NumberFormat), and about this new Intl object that is specialized in formatting durations. :sli

Validations

@Ericlm Ericlm added the Status: Proposal Request for comments label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

1 participant