fix(web): add dayjs relativeTime plugin (#22761)

pull/21682/merge
quicksand 7 months ago committed by GitHub
parent ce15ca8929
commit 90c4df7919
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,7 +1,10 @@
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()
const formatTimeFromNow = useCallback((time: number) => {

Loading…
Cancel
Save