From 37a10b735413b2517950e8fe0e637e5f184d5b30 Mon Sep 17 00:00:00 2001 From: shibafu Date: Mon, 16 Dec 2019 22:56:11 +0900 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E9=96=93=E3=83=81=E3=82=A7=E3=83=83?= =?UTF-8?q?=E3=82=AF=E3=82=A4=E3=83=B3=E5=9B=9E=E6=95=B0=E3=82=B0=E3=83=A9?= =?UTF-8?q?=E3=83=95=E3=81=AE=E6=9C=9F=E9=96=93=E3=82=BB=E3=83=AC=E3=82=AF?= =?UTF-8?q?=E3=82=BF=E3=83=BC=E3=81=8C=E3=80=81=E7=9B=B4=E8=BF=911?= =?UTF-8?q?=E5=B9=B4=E3=81=AE=E7=AF=84=E5=9B=B2=E3=81=97=E3=81=8B=E9=81=B8?= =?UTF-8?q?=E6=8A=9E=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=83=90=E3=82=B0?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/user/stats.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/user/stats.js b/resources/assets/js/user/stats.js index 25e4895..971b2ad 100644 --- a/resources/assets/js/user/stats.js +++ b/resources/assets/js/user/stats.js @@ -105,7 +105,8 @@ createBarGraph('dow-graph', ['日', '月', '火', '水', '木', '金', '土'], g // 月間グラフの期間セレクターを準備 const monthlyTermSelector = document.getElementById('monthly-term'); -for (let year = monthlyTermFrom.getFullYear(); year <= new Date().getFullYear(); year++) { +const earliestYear = [...new Set(Object.keys(graphData.monthlySum).map(v => v.substr(0, 4)))].shift(); +for (let year = earliestYear; year <= new Date().getFullYear(); year++) { const opt = document.createElement('option'); opt.setAttribute('value', year); opt.textContent = `${year}年`;