Skip to content

Commit

Permalink
change: 試合を時間順に表示するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
testusuke committed May 21, 2024
1 parent ef0dde7 commit 0dec2f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/match/matchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ export type MatchListProps = {
}

export default async function MatchList(props: MatchListProps) {
const components = props.matches.map((match) =>
const components = props.matches
// sort by date in ascending order
.sort((a, b) => new Date(a.startAt).getTime() - new Date(b.startAt).getTime())
.map((match) =>
<MatchCard
match={match}
key={match.id}
Expand Down

0 comments on commit 0dec2f0

Please sign in to comment.