github / github/relative-time-element
Enable passing `formatStyle` to Intl.DateTimeFormat
- Dominant language
- JavaScript
- Stars
- 4k
- Forks
- 192
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Description
[Here](https://github.com/github/relative-time-element/blob/3a8f30f1a66edbe8d4e76c721ff1767c49b0ed27/src/relative-time-element.ts#L173) A style argument is being passed to the config of the Intl.RelativeTimeFormat constructor.
[But Here](https://github.com/github/relative-time-element/blob/3a8f30f1a66edbe8d4e76c721ff1767c49b0ed27/src/relative-time-element.ts#L188) 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 :thinking:
Contributor guide
Assessment
This issue has not been assessed yet.