Browse Source

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

tags/1.7.0
quicksand 3 months ago
parent
commit
90c4df7919
No account linked to committer's email address
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      web/app/components/tools/mcp/hooks.ts

+ 3
- 0
web/app/components/tools/mcp/hooks.ts View File

@@ -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