fix: show N/A for generic date data

This commit is contained in:
Pinapelz
2025-11-08 21:29:49 -08:00
parent 69e11de80c
commit 6649c6d950
8 changed files with 112 additions and 80 deletions
@@ -324,16 +324,20 @@ const DancearoundScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -318,16 +318,20 @@ const DancerushScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -363,16 +363,20 @@ const DivaScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -332,16 +332,20 @@ const ScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-[10px] sm:text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -336,16 +336,20 @@ const MusicDiverDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-[10px] sm:text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -325,16 +325,20 @@ const NostalgiaScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-[10px] sm:text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -322,16 +322,20 @@ const ReflecBeatScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-[10px] sm:text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>
@@ -416,16 +416,20 @@ const TaikoScoreDisplay: React.FC<ScoreDisplayProps> = ({
{/* Timestamp */}
<div className="pt-4 border-t border-slate-800/50">
<p className="text-slate-500 text-[10px] sm:text-xs">
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
{timestamp === 0 ? "N/A" : (
<>
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleDateString()}{" "}
{" "}
{new Date(
typeof timestamp === "number" ? timestamp : timestamp,
).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
})}
</>
)}
</p>
</div>
</div>