Skip to content

Commit

Permalink
fix(date): support Unix timestamp string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoAria committed Dec 7, 2024
1 parent 9b8cb29 commit 682d61b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dayjs.extend(relativeTime)
dayjs.extend(utc)

export const checkIsInLast24Hours = (dateString) => {
const targetDate = dayjs(dateString)
const targetDate = /^\d+$/.test(dateString) ? dayjs(Number(dateString) * 1000) : dayjs(dateString)
return targetDate.isAfter(dayjs().subtract(24, "hour"))
}

Expand Down

0 comments on commit 682d61b

Please sign in to comment.