aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/ScheduleInteractive.astro
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-28 06:48:14 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-28 06:48:14 +0900
commit9ab2b28e526b2c80edaed0e569b9be06bf70f446 (patch)
treebe8718cdd27e48a662e3c9ed7228b2c64cca9e69 /src/components/ScheduleInteractive.astro
parent51963db35cf552508762ac996bfe965ea3484b9d (diff)
hp-archive: 市Xの新着と予定ページの表示を改善
- 市公式Xの10月27日の新着5件を追加 - 出張マザーズハローワークの相談会を追加 - 鈴木遺跡のテレビ放映、小平産農産物即売会を追加 - カレンダーの初期表示を当日にし、案内ページのリンクをカード化 - 終了表示を10月27日分までに変更
Diffstat (limited to 'src/components/ScheduleInteractive.astro')
-rw-r--r--src/components/ScheduleInteractive.astro12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro
index 37ab7c7..fdc0767 100644
--- a/src/components/ScheduleInteractive.astro
+++ b/src/components/ScheduleInteractive.astro
@@ -203,16 +203,18 @@
return;
}
- const months = [...new Set(dateKeys.map((k) => k.slice(0, 7)))].sort();
const today = new Date();
const todayKey = toKey(today.getFullYear(), today.getMonth() + 1, today.getDate());
+ const todayMonth = todayKey.slice(0, 7);
+ // 今日の月もカレンダーで移動できるように含める。
+ const months = [...new Set([...dateKeys.map((k) => k.slice(0, 7)), todayMonth])].sort();
- // 開催日が今日までのものは「終了」と表示する。
+ // 開催日が今日より前のものは「終了」と表示する。
// 複数回の催しで未来の回が残っているものは対象外。
for (const entry of entries) {
if (entry.dateText.includes('申込開始')) continue;
if (entry.dates.length === 0) continue;
- if (!entry.dates.every((d) => d <= todayKey)) continue;
+ if (!entry.dates.every((d) => d < todayKey)) continue;
const row = document.getElementById(entry.rowId);
if (!row) continue;
row.classList.add('is-ended');
@@ -224,8 +226,8 @@
}
}
- let selectedDate = byDate.has(todayKey) ? todayKey : dateKeys[0];
- let currentMonth = selectedDate.slice(0, 7);
+ let selectedDate = todayKey;
+ let currentMonth = todayMonth;
let activeCategory = 'all';
function matchesCategory(e) {