feat: import and extend dayjs relativeTime plugin in multiple components

This commit is contained in:
twwu
2025-07-18 14:15:07 +08:00
parent 6ca5bc1063
commit 32fe8313b4
3 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,8 @@
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import { useCallback } from 'react'
import { useI18N } from '@/context/i18n'
dayjs.extend(relativeTime)
export const useFormatTimeFromNow = () => {
const { locale } = useI18N()