Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/primitives/Time.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export type TimeProps = {
export default function Time({ timestamp, prefix }: TimeProps) {
const time = useMemo(() => {
const targetTime = moment(Number(timestamp));
const isPast = targetTime.isBefore(moment());

const then = targetTime
.fromNow()
.replace(/in\s/, prefix ? `${prefix} ` : "End in ")
Expand All @@ -22,7 +20,7 @@ export default function Time({ timestamp, prefix }: TimeProps) {
.replace(/\bday(s?)\b/g, (_match, plural) => (plural ? "days" : "day"))
.replace(/\bmonth(s?)\b/g, (_match, plural) => (plural ? "months" : "month"));

return isPast ? `Ended ${then}` : then;
return then;
}, [timestamp, prefix]);

return time;
Expand Down