aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/ScheduleInteractive.astro
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-05 14:58:06 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-05 14:58:06 +0900
commite7b60d5ef8c8cf5471a62498fd0a88f61cd2812e (patch)
tree7a7033fc634baa1d7695dd52e90961e98cfc5e16 /src/components/ScheduleInteractive.astro
parent3e02a6a05c6a5b26fbb19fa91be9afbc6b12877d (diff)
events: メインは前月以降、アーカイブは前々月以前に分ける
メインページの一覧とカレンダーを前月以降に広げ、前々月以前の月だけを アーカイブとして生成するようにした。該当が無いときはアーカイブ欄に その旨を表示する。月が進めば自動でページが増える。 RSSと旧URLの転送先も、存在しない月ページを指さないよう合わせた。
Diffstat (limited to 'src/components/ScheduleInteractive.astro')
-rw-r--r--src/components/ScheduleInteractive.astro6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro
index 30569db..f0bd73c 100644
--- a/src/components/ScheduleInteractive.astro
+++ b/src/components/ScheduleInteractive.astro
@@ -1,7 +1,7 @@
<script>
// URLは src/data/schedule/config.ts で一元管理している(ページ移転時はそこだけ変える)
import { scheduleAbsoluteUrl } from '@/data/schedule/config';
- import { parseDates, applyExclusions, toKey, keyToDate, entryDates } from '@/lib/schedule-dates';
+ import { parseDates, applyExclusions, toKey, keyToDate, entryDates, mainStartMonth } from '@/lib/schedule-dates';
const CATEGORY_DEFS = [
{ icon: '👶', label: '子育て' },
@@ -100,9 +100,9 @@
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])]
- .filter((month) => month >= todayMonth)
+ .filter((month) => month >= mainStartMonth())
.sort();
// 開催日が今日より前のものは「終了」と表示する。