From 2aa3e671d89eac2ea0826886fe8a16c1adea2e66 Mon Sep 17 00:00:00 2001 From: 836334258 <99860051+836334258@users.noreply.github.com> Date: Fri, 11 Nov 2022 20:11:11 +0800 Subject: [PATCH] refactor(getTimeAgo): rename `getTimeago` to `getTimeAgo` (#2427) --- packages/core/useTimeAgo/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/useTimeAgo/index.ts b/packages/core/useTimeAgo/index.ts index 62099b7e112..94967b9c96b 100644 --- a/packages/core/useTimeAgo/index.ts +++ b/packages/core/useTimeAgo/index.ts @@ -129,7 +129,7 @@ export function useTimeAgo(time: MaybeComputedRef, optio const { abs, round } = Math const { now, ...controls } = useNow({ interval: updateInterval, controls: true }) - function getTimeago(from: Date, now: Date) { + function getTimeAgo(from: Date, now: Date) { const diff = +now - +from const absDiff = abs(diff) @@ -167,7 +167,7 @@ export function useTimeAgo(time: MaybeComputedRef, optio return applyFormat(past ? 'past' : 'future', str, past) } - const timeAgo = computed(() => getTimeago(new Date(resolveUnref(time)), unref(now.value))) + const timeAgo = computed(() => getTimeAgo(new Date(resolveUnref(time)), unref(now.value))) if (exposeControls) { return {