Add date for batch create
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user