Add date for batch create
This commit is contained in:
@@ -3,6 +3,10 @@ class BatchCreateHandler {
|
|||||||
constructor(headerSpace) {
|
constructor(headerSpace) {
|
||||||
const elements = createBtnGroupArea('batch-action-area', '出欠簿一括作成', this.handleCreateData, {
|
const elements = createBtnGroupArea('batch-action-area', '出欠簿一括作成', this.handleCreateData, {
|
||||||
btnElId: 'batch-btn',
|
btnElId: 'batch-btn',
|
||||||
|
yearElId: 'batch-year',
|
||||||
|
monthElId: 'batch-month',
|
||||||
|
dateElId: 'batch-date',
|
||||||
|
defaultThisMonth: true,
|
||||||
})
|
})
|
||||||
if (!elements) {
|
if (!elements) {
|
||||||
return;
|
return;
|
||||||
@@ -10,7 +14,7 @@ class BatchCreateHandler {
|
|||||||
headerSpace.appendChild(elements['batch-action-area']);
|
headerSpace.appendChild(elements['batch-action-area']);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleCreateData = async (e) => {
|
handleCreateData = async (e, { year, month, date }) => {
|
||||||
loading(true, '出欠簿一括作成中...');
|
loading(true, '出欠簿一括作成中...');
|
||||||
showError(false);
|
showError(false);
|
||||||
const api = new KintoneRestAPIClient();
|
const api = new KintoneRestAPIClient();
|
||||||
@@ -23,7 +27,7 @@ class BatchCreateHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const today = new Date();
|
const today = new Date(year, month - 1, date);
|
||||||
const todayString = getFormatDateString(today);
|
const todayString = getFormatDateString(today);
|
||||||
const records = this.generateRecords(today, todayString, masterRecords);
|
const records = this.generateRecords(today, todayString, masterRecords);
|
||||||
// console.log(records);
|
// console.log(records);
|
||||||
|
|||||||
Reference in New Issue
Block a user