Skip to content

Support for Intl.DurationFormat #2049

@Ericlm

Description

@Ericlm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions