Skip to content

Get time interval with formatDateInterval #8

@gmarty

Description

@gmarty

I'm trying to get a localised time interval using cldr.Calendars.formatDateInterval. It always returns the date no matter what skeleton I pass as an option. e.g.:

cldr.Calendars.formatDateInterval(
  start,
  end,
  {
    skeleton: 'Hmm',
    ca: 'gregory',
  }
)

Returns something like this with the ja language:

1/1 18:15~12/31 18:45

I'd like to get:

18:15~18:45
// Or even better:
18時15分~18時45分

When I look inside the language pack for Japanese, I see patterns like this one:

H時mm分~H時mm分

So it looks like the information is there, but somehow not surfaced.

I'd like to either have this function to comply more closely to the skeleton or a different function called cldr.Calendars.formatTimeInterval.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions