add support for blog

This commit is contained in:
2025-08-25 21:13:08 +07:00
parent 0dee6824ad
commit 963f460e8a
6 changed files with 160 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime'
import 'dayjs/locale/en'
dayjs.extend(relativeTime)
export const useRelativeDate = (date: string) => {
dayjs.locale('en')
return dayjs().to(dayjs(date))
}