UNPKG

holidays-kr

Version:

data.go.kr 데이터 기반 공휴일 수집

25 lines 823 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addDay = exports.zerofill = void 0; const zerofill = (number, digit) => { return ("00000000" + number).slice(-digit); }; exports.zerofill = zerofill; const addDay = ({ isHoliday, locdate, dateName }, holidays) => { if (isHoliday !== "Y") return; const locDateStr = `${locdate}`; const year = parseInt(locDateStr.substring(0, 4)); const month = parseInt(locDateStr.substring(4, 6)); const day = parseInt(locDateStr.substring(6, 8)); const dateStr = [year, (0, exports.zerofill)(month, 2), (0, exports.zerofill)(day, 2)].join("-"); holidays.push({ name: dateName, year, month, day, dateStr, }); }; exports.addDay = addDay; //# sourceMappingURL=utils.js.map