From 5da04f755e7a93b208f2c0b88ea74922b027b2b0 Mon Sep 17 00:00:00 2001 From: msickpaler Date: Thu, 16 Mar 2023 22:44:43 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=A7=E6=97=A5=E4=BB=98=E3=81=A7=E3=82=BD=E3=83=BC=E3=83=88?= =?UTF-8?q?=E5=BF=98=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nextjs/src/pages/data/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/nextjs/src/pages/data/index.tsx b/nextjs/src/pages/data/index.tsx index cf38ce8..9b8827c 100644 --- a/nextjs/src/pages/data/index.tsx +++ b/nextjs/src/pages/data/index.tsx @@ -108,10 +108,12 @@ export const getStaticProps = async () => { return acc; }, {} as Record); - 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: {