Add knossos

This commit is contained in:
Jai A
2024-07-03 13:05:14 -07:00
parent 4736fb8e32
commit 10785f156f
357 changed files with 1441 additions and 13039 deletions

View File

@@ -0,0 +1,18 @@
import { createFormatter, type Formatter } from '@vintl/how-ago'
import type { IntlController } from '@vintl/vintl/controller'
const formatters = new WeakMap<IntlController<any>, Formatter>()
export function useRelativeTime(): Formatter {
const vintl = useVIntl()
let formatter = formatters.get(vintl)
if (formatter == null) {
const formatterRef = computed(() => createFormatter(vintl.intl))
formatter = (value, options) => formatterRef.value(value, options)
formatters.set(vintl, formatter)
}
return formatter
}