From 6649c6d950ee4216773d55f71b7e28eaef715ef5 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sat, 8 Nov 2025 21:29:49 -0800 Subject: fix: show N/A for generic date data --- .../displays/DancearoundScoreDisplay.tsx | 24 +++++++++++++--------- .../components/displays/DancerushScoreDisplay.tsx | 24 +++++++++++++--------- .../src/components/displays/DivaScoreDisplay.tsx | 24 +++++++++++++--------- .../components/displays/GenericScoreDisplay.tsx | 24 +++++++++++++--------- .../components/displays/MusicDiverScoreDisplay.tsx | 24 +++++++++++++--------- .../components/displays/NostalgiaScoreDisplay.tsx | 24 +++++++++++++--------- .../components/displays/ReflecBeatScoreDisplay.tsx | 24 +++++++++++++--------- .../src/components/displays/TaikoScoreDisplay.tsx | 24 +++++++++++++--------- 8 files changed, 112 insertions(+), 80 deletions(-) (limited to 'frontend/src/components/displays') 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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

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 = ({ {/* Timestamp */}

- {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", + })} + + )}

-- cgit v1.2.3