summaryrefslogtreecommitdiffhomepage
path: root/scripts/update-library-dates.mjs
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-23 09:51:30 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-11-23 09:51:30 +0900
commitaa591b1fd65253f925138b3ad5d1b9688b2a9122 (patch)
tree3f12b512feb851ea91da6fe95e0809ab2adc6aba /scripts/update-library-dates.mjs
parentbe3c9c978843453c46a599792450d9750d005630 (diff)
events.json: 図書館イベントの出典に図書館ページを併記
- 秋のおはなし工作会・図書館のスペシャルおはなし会の source に図書館のページを追加 - update-library-dates.mjs: 市報など他の出典を併記している行は自動同期しない (図書館カレンダーに誤りがある事例があるため)
Diffstat (limited to 'scripts/update-library-dates.mjs')
-rw-r--r--scripts/update-library-dates.mjs12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/update-library-dates.mjs b/scripts/update-library-dates.mjs
index 74b9302..a41fae1 100644
--- a/scripts/update-library-dates.mjs
+++ b/scripts/update-library-dates.mjs
@@ -109,6 +109,7 @@ async function main() {
const inTable = new Map();
const changes = [];
+ const skipped = [];
for (const row of rows) {
const m = (row.source || '').match(LIB_SOURCE_RE);
@@ -116,6 +117,13 @@ async function main() {
const id = m[1];
inTable.set(id, { name: row.title, datesCell: row.date, row });
+ // 市報など他の出典を併記している行は、そちらの日付を優先して自動同期しない
+ // (図書館のカレンダーに誤りがある事例が判明しているため)。
+ if (/市報/.test(row.source || '')) {
+ skipped.push(row.title);
+ continue;
+ }
+
const ev = events.get(id);
if (!ev || ev.dates.size === 0) continue;
const next = formatDates(ev.dates, ev.dates.size === 1);
@@ -123,6 +131,10 @@ async function main() {
}
console.log(`図書館の予定: カレンダー ${events.size}件 / 表 ${inTable.size}件(${months}か月分を取得)`);
+ if (skipped.length > 0) {
+ console.log('(市報の日付を優先し、自動同期しない行)');
+ for (const name of skipped) console.log(`- ${name}`);
+ }
if (changes.length === 0) {
console.log('日付の変更はありません。');