This commit is contained in:
parent
eeb4f56e79
commit
05f98bf4a7
@ -9,6 +9,7 @@ import { InformationCircleIcon } from "@heroicons/react/16/solid";
|
|||||||
import { format } from "@formkit/tempo";
|
import { format } from "@formkit/tempo";
|
||||||
import { PlayerTrackedSince } from "@/common/player/player-tracked-since";
|
import { PlayerTrackedSince } from "@/common/player/player-tracked-since";
|
||||||
import { getDaysAgo } from "@/common/time-utils";
|
import { getDaysAgo } from "@/common/time-utils";
|
||||||
|
import { formatNumberWithCommas } from "@/common/number-utils";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
player: ScoreSaberPlayer;
|
player: ScoreSaberPlayer;
|
||||||
@ -31,7 +32,7 @@ export default function PlayerTrackedStatus({ player }: Props) {
|
|||||||
|
|
||||||
const trackedSince = new Date(data.trackedSince!);
|
const trackedSince = new Date(data.trackedSince!);
|
||||||
const daysAgo = getDaysAgo(trackedSince) + 1;
|
const daysAgo = getDaysAgo(trackedSince) + 1;
|
||||||
let daysAgoFormatted = `${daysAgo} day${daysAgo > 1 ? "s" : ""} ago`;
|
let daysAgoFormatted = `${formatNumberWithCommas(daysAgo)} day${daysAgo > 1 ? "s" : ""} ago`;
|
||||||
if (daysAgo === 1) {
|
if (daysAgo === 1) {
|
||||||
daysAgoFormatted = "Today";
|
daysAgoFormatted = "Today";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user