Fix: fromNow date reversal

This commit is contained in:
Dreamacro 2022-06-04 20:41:25 +08:00
parent 13fa9b96bb
commit 02574691d4

View File

@ -8,5 +8,5 @@ dayjs.extend(relativeTime)
export function fromNow (date: Date, lang: Lang): string { export function fromNow (date: Date, lang: Lang): string {
const locale = lang === 'en_US' ? 'en' : 'zh-cn' const locale = lang === 'en_US' ? 'en' : 'zh-cn'
return dayjs().locale(locale).from(date) return dayjs(date).locale(locale).from(dayjs())
} }