diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-11-08 21:29:49 -0800 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-11-08 21:29:49 -0800 |
| commit | 6649c6d950ee4216773d55f71b7e28eaef715ef5 (patch) | |
| tree | 5cef444a75168b2bae2188565a80b3e4c4b58a64 | |
| parent | 69e11de80c00a12d2c35d55ddfffa40550713442 (diff) | |
fix: show N/A for generic date data
8 files changed, 112 insertions, 80 deletions
diff --git a/frontend/src/components/displays/DancearoundScoreDisplay.tsx b/frontend/src/components/displays/DancearoundScoreDisplay.tsx index 973e96c..4b365dd 100644 --- a/frontend/src/components/displays/DancearoundScoreDisplay.tsx +++ b/frontend/src/components/displays/DancearoundScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/DancerushScoreDisplay.tsx b/frontend/src/components/displays/DancerushScoreDisplay.tsx index 201087e..85bdae8 100644 --- a/frontend/src/components/displays/DancerushScoreDisplay.tsx +++ b/frontend/src/components/displays/DancerushScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/DivaScoreDisplay.tsx b/frontend/src/components/displays/DivaScoreDisplay.tsx index a6c6dab..8f9262b 100644 --- a/frontend/src/components/displays/DivaScoreDisplay.tsx +++ b/frontend/src/components/displays/DivaScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/GenericScoreDisplay.tsx b/frontend/src/components/displays/GenericScoreDisplay.tsx index a52b157..08d15ef 100644 --- a/frontend/src/components/displays/GenericScoreDisplay.tsx +++ b/frontend/src/components/displays/GenericScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/MusicDiverScoreDisplay.tsx b/frontend/src/components/displays/MusicDiverScoreDisplay.tsx index 3d91412..9da742f 100644 --- a/frontend/src/components/displays/MusicDiverScoreDisplay.tsx +++ b/frontend/src/components/displays/MusicDiverScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/NostalgiaScoreDisplay.tsx b/frontend/src/components/displays/NostalgiaScoreDisplay.tsx index b64a059..723a3f0 100644 --- a/frontend/src/components/displays/NostalgiaScoreDisplay.tsx +++ b/frontend/src/components/displays/NostalgiaScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx b/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx index 27260e8..fc7a483 100644 --- a/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx +++ b/frontend/src/components/displays/ReflecBeatScoreDisplay.tsx @@ -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> diff --git a/frontend/src/components/displays/TaikoScoreDisplay.tsx b/frontend/src/components/displays/TaikoScoreDisplay.tsx index 3c6ea01..d67847a 100644 --- a/frontend/src/components/displays/TaikoScoreDisplay.tsx +++ b/frontend/src/components/displays/TaikoScoreDisplay.tsx @@ -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> |
