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);