0,1歳日誌データ連携
This commit is contained in:
@@ -136,7 +136,7 @@ function createBtnGroupArea(groupId, btnLabel, btnOnClick, { btnElId = false, ye
|
||||
function checkInputData(map, { btnLabel, yearElId, monthElId, dateElId, classElId }) {
|
||||
const year = yearElId && map[yearElId].value;
|
||||
const month = monthElId && map[monthElId].value;
|
||||
const date = dateElId && (map[dateElId].value === 'end' ? getLastDate(year, month) : map[dateElId].value);
|
||||
const date = dateElId && (map[dateElId].value === 'end' ? getLastDate(year, month).getDate() : map[dateElId].value);
|
||||
const className = classElId && map[classElId].value;
|
||||
|
||||
const errorMsgs = [];
|
||||
@@ -170,7 +170,7 @@ function checkInputData(map, { btnLabel, yearElId, monthElId, dateElId, classElI
|
||||
}
|
||||
|
||||
function getLastDate(year, month) {
|
||||
return new Date(year, month, 0).getDate();
|
||||
return new Date(year, month, 0);
|
||||
}
|
||||
|
||||
function createBtn(id, label, onClick) {
|
||||
@@ -239,9 +239,9 @@ function getFormatDateString(dateObjOrYear, month, date) {
|
||||
}
|
||||
const formatY = year;
|
||||
const formatM = String(month).padStart(2, '0');
|
||||
const formatD = date ? String(date).padStart(2, '0') : '';
|
||||
const formatD = String(date).padStart(2, '0');
|
||||
|
||||
return formatY + '-' + formatM + (formatD && ('-' + formatD));
|
||||
return `${formatY}-${formatM}-${formatD}`;
|
||||
}
|
||||
|
||||
function loading(show, text) {
|
||||
|
||||
Reference in New Issue
Block a user