Skip to content

Commit

Permalink
refactor(getTimeAgo): rename getTimeago to getTimeAgo (#2427)
Browse files Browse the repository at this point in the history
  • Loading branch information
836334258 committed Nov 11, 2022
1 parent 32098fc commit 2aa3e67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useTimeAgo/index.ts
Expand Up @@ -129,7 +129,7 @@ export function useTimeAgo(time: MaybeComputedRef<Date | number | string>, 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)

Expand Down Expand Up @@ -167,7 +167,7 @@ export function useTimeAgo(time: MaybeComputedRef<Date | number | string>, 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 {
Expand Down

0 comments on commit 2aa3e67

Please sign in to comment.