aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/docs/kodaira/events.mdx2
-rw-r--r--src/pages/kodaira/events/[period].astro31
2 files changed, 27 insertions, 6 deletions
diff --git a/src/content/docs/kodaira/events.mdx b/src/content/docs/kodaira/events.mdx
index b3636bc..5374177 100644
--- a/src/content/docs/kodaira/events.mdx
+++ b/src/content/docs/kodaira/events.mdx
@@ -97,7 +97,7 @@ import ScheduleMonthLinks from '../../../components/ScheduleMonthLinks.astro';
## 月別のアーカイブ
-過去の月の予定は、月ごとのページで見られます。年度ごとの一覧もあります。
+月ごと・年度ごとのページに分けて、それぞれの期間の予定を見られます。
<ScheduleMonthLinks />
diff --git a/src/pages/kodaira/events/[period].astro b/src/pages/kodaira/events/[period].astro
index 7ef4599..084760c 100644
--- a/src/pages/kodaira/events/[period].astro
+++ b/src/pages/kodaira/events/[period].astro
@@ -59,20 +59,41 @@ const eventRows =
const months = kind === 'fiscal' ? monthsInFiscalYear(key) : [];
const url = (period: string) => `${SCHEDULE_BASE_PATH}${period}/`;
+
+// 期間がすべて過去か、すべて未来か、今日を含むかで説明文を変える。
+// (過去の月に「今後の予定です」と書いたり、未来の月に「終了分も掲載」と書いたりしない)
+const pad = (n: number) => String(n).padStart(2, '0');
+const now = new Date();
+const currentMonth = `${now.getFullYear()}-${pad(now.getMonth() + 1)}`;
+const periodMonths = kind === 'fiscal' ? monthsInFiscalYear(key) : [key];
+const firstMonth = periodMonths[0] ?? key;
+const lastMonth = periodMonths[periodMonths.length - 1] ?? key;
+const isAllPast = lastMonth < currentMonth;
+const isAllFuture = firstMonth > currentMonth;
+
+const lead = isAllPast
+ ? `${label}の小平市のイベントと、審議会等・市議会の予定を、記録として掲載しています。`
+ : isAllFuture
+ ? `${label}の小平市のイベントと、審議会等・市議会の開催予定です。`
+ : `${label}の小平市のイベントと、審議会等・市議会の開催予定です。開催日が過ぎたものもあわせて掲載しています。`;
+const caution = isAllPast
+ ? '掲載内容は、掲載時点のものです。'
+ : '変更になることがありますので、各問い合わせ先へご確認ください。';
+
+const description = isAllPast
+ ? `${label}に開催された小平市のイベントと、審議会・市議会の予定の記録です。日程・会場を確認できます。`
+ : `${label}の小平市のイベントと、審議会・市議会の開催予定の一覧です。日程・会場・申込期限を確認できます。`;
---
<StarlightPage
frontmatter={{
title: `小平市のイベント・行事予定(${label})`,
- description: `${label}の小平市のイベントと、審議会・市議会の開催予定の一覧です。日程・会場・申込期限を確認できます。`,
+ description,
}}
>
<p><a href={SCHEDULE_BASE_PATH}>← 小平市のイベント・行事予定カレンダー(今後)に戻る</a></p>
- <p>
- {label}の小平市のイベントと、審議会等・市議会の開催予定です。開催日が過ぎたものも記録として掲載しています。
- 変更になることがありますので、各問い合わせ先へご確認ください。
- </p>
+ <p>{lead}{caution}</p>
{
kind === 'fiscal' && (