月間チェックイン回数グラフの期間セレクターが、直近1年の範囲しか選択できないバグを修正

This commit is contained in:
shibafu 2019-12-16 22:56:11 +09:00
parent 6ea360bc4e
commit 37a10b7354

View File

@ -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}`;