Open intervalia opened 3 months ago
Describe the bug Add a new pipe called toRelTime that uses Intl.RelativeTimeFormat
toRelTime
Intl.RelativeTimeFormat
The CPA value to be piped can be:
A number | numeric string - Requires data attributes: data-locale="en | fr | ..." // Defaults to page or browser settings data-rt-unit="year | quarter | month | week | day | hour | minute | second" // Defaults to "day" data-rt-style="long | short | narrow" // defaults to "long" data-rt-numeric="auto | always" // Defaults to "auto"
data-locale="en | fr | ..."
data-rt-unit="year | quarter | month | week | day | hour | minute | second"
data-rt-style="long | short | narrow"
data-rt-numeric="auto | always"
An object: (Passing in an object overrides the data attributes.)
{ "value": <number | numeric string>, "unit": "year | quarter | month | week | day | hour | minute | second", // Defaults to "day" "locale": "en | fr | ...", // Defaults to page or browser settings "style": "long | short | narrow", // defaults to "long" "numeric": "auto | always" // Defaults to "auto" }
Describe the bug Add a new pipe called
toRelTime
that usesIntl.RelativeTimeFormat
The CPA value to be piped can be:
A number | numeric string - Requires data attributes:
data-locale="en | fr | ..."
// Defaults to page or browser settingsdata-rt-unit="year | quarter | month | week | day | hour | minute | second"
// Defaults to "day"data-rt-style="long | short | narrow"
// defaults to "long"data-rt-numeric="auto | always"
// Defaults to "auto"An object: (Passing in an object overrides the data attributes.)