Skip to content

Commit

Permalink
feat: created_atの表示形式をYYYY-MM-DDに変更
Browse files Browse the repository at this point in the history
  • Loading branch information
araaki12345 committed Apr 6, 2024
1 parent 2046f21 commit 0d2323c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion typing-app/src/components/molecules/RankingTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const RankingTableRow: React.FC<components["schemas"]["ScoreRanking"]> = (scoreR
const formattedAccuracy = new Intl.NumberFormat("en-US", { style: "percent", maximumFractionDigits: 2 }).format(
accuracy
);
const formattedCreatedAt = scoreRanking.score?.created_at
? new Date(scoreRanking.score.created_at).toISOString().split("T")[0]
: "";
return (
<Tr
key={String(scoreRanking.score?.user?.student_number)}
Expand All @@ -26,7 +29,7 @@ const RankingTableRow: React.FC<components["schemas"]["ScoreRanking"]> = (scoreR
{formattedAccuracy}
</Td>
<Td width={"320px"} textAlign={"center"}>
{scoreRanking.score?.created_at}
{formattedCreatedAt}
</Td>
</Tr>
);
Expand Down

0 comments on commit 0d2323c

Please sign in to comment.