We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32456c2 commit d964fd7Copy full SHA for d964fd7
src/runtime/components/NuxtTime.vue
@@ -122,7 +122,8 @@ if (import.meta.server) {
122
{ unit: 'year', value: diffInSeconds / 31536000 },
123
]
124
const { unit, value } = units.find(({ value }) => Math.abs(value) < 60) || units[units.length - 1]!
125
- el.textContent = formatter.value.format(Math.round(value), unit)
+ const formatter = new Intl.RelativeTimeFormat(options.locale, options)
126
+ el.textContent = formatter.format(Math.round(value), unit)
127
}
128
else {
129
const formatter = new Intl.DateTimeFormat(options.locale, options)
0 commit comments