Skip to content

Commit

Permalink
データ画面で日付でソート忘れていたので追加
Browse files Browse the repository at this point in the history
  • Loading branch information
msickpaler committed Mar 16, 2023
1 parent 1618565 commit 5da04f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nextjs/src/pages/data/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ export const getStaticProps = async () => {
return acc;
}, {} as Record<string, number>);

const dataByMonthArr = Object.entries(dataByMonth).map(([month, count]) => ({
month,
count,
}));
const dataByMonthArr = Object.entries(dataByMonth)
.map(([month, count]) => ({
month,
count,
}))
.sort((a, b) => new Date(a.month).getTime() - new Date(b.month).getTime());

return {
props: {
Expand Down

1 comment on commit 5da04f7

@vercel
Copy link

@vercel vercel bot commented on 5da04f7 Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.