mirror of
https://gitea.tendokyu.moe/pinapelz/Mirage.git
synced 2026-09-22 22:38:04 +03:00
fix: show N/A for generic date data
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user