From 6831a7ae1ec1aa311692651d9500da173c6b18da Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Thu, 8 May 2025 10:01:19 +0800 Subject: [PATCH] Add date for batch create --- src/園児別出欠簿入力/BatchCreateHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/園児別出欠簿入力/BatchCreateHandler.js b/src/園児別出欠簿入力/BatchCreateHandler.js index 731861f..91892b8 100644 --- a/src/園児別出欠簿入力/BatchCreateHandler.js +++ b/src/園児別出欠簿入力/BatchCreateHandler.js @@ -3,6 +3,10 @@ class BatchCreateHandler { constructor(headerSpace) { const elements = createBtnGroupArea('batch-action-area', '出欠簿一括作成', this.handleCreateData, { btnElId: 'batch-btn', + yearElId: 'batch-year', + monthElId: 'batch-month', + dateElId: 'batch-date', + defaultThisMonth: true, }) if (!elements) { return; @@ -10,7 +14,7 @@ class BatchCreateHandler { headerSpace.appendChild(elements['batch-action-area']); } - handleCreateData = async (e) => { + handleCreateData = async (e, { year, month, date }) => { loading(true, '出欠簿一括作成中...'); showError(false); const api = new KintoneRestAPIClient(); @@ -23,7 +27,7 @@ class BatchCreateHandler { return; } - const today = new Date(); + const today = new Date(year, month - 1, date); const todayString = getFormatDateString(today); const records = this.generateRecords(today, todayString, masterRecords); // console.log(records);