diff --git a/lib/cjs/year_holidays/2024.d.ts b/lib/cjs/year_holidays/2024.d.ts new file mode 100644 index 0000000..d9eb394 --- /dev/null +++ b/lib/cjs/year_holidays/2024.d.ts @@ -0,0 +1,2 @@ +import { IYearHolidays } from './types.js'; +export declare const HOLIDAYS_2024: IYearHolidays; diff --git a/lib/cjs/year_holidays/2024.js b/lib/cjs/year_holidays/2024.js new file mode 100644 index 0000000..90d0570 --- /dev/null +++ b/lib/cjs/year_holidays/2024.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HOLIDAYS_2024 = void 0; +exports.HOLIDAYS_2024 = { + 1: { + 1: true, // 새해 + }, + 2: { + 9: true, // 설날 연휴 + 10: true, // 설날 + 11: true, // 설날 연휴 + 12: true, // 대체공휴일 + }, + 3: { + 1: true, // 삼일절 + }, + 4: { + 10: true, // 22대 국회의원 선거 + }, + 5: { + 1: true, // 근로자의 날 + 5: true, // 어린이날 + 6: true, // 어린이날 대체공휴일 + 15: true, // 부처님 오신날 + }, + 6: { + 6: true, // 현충일 + }, + 7: {}, + 8: { + 15: true, // 광복절 + }, + 9: { + 16: true, // 추석 연휴 + 17: true, // 추석 + 18: true, // 추석 연휴 + }, + 10: { + 3: true, // 개천절 + 9: true, // 한글날 + }, + 11: {}, + 12: { + 25: true, // 성탄절 + }, +}; diff --git a/lib/cjs/year_holidays/index.js b/lib/cjs/year_holidays/index.js index b276f59..44544d1 100644 --- a/lib/cjs/year_holidays/index.js +++ b/lib/cjs/year_holidays/index.js @@ -6,6 +6,7 @@ var _2020_js_1 = require("./2020.js"); var _2021_js_1 = require("./2021.js"); var _2022_js_1 = require("./2022.js"); var _2023_js_1 = require("./2023.js"); +var _2024_js_1 = require("./2024.js"); // 토, 일요일 정보는 포함하지 않음 exports.KOREAN_HOLIDAYS = { 2019: _2019_js_1.HOLIDAYS_2019, @@ -13,6 +14,7 @@ exports.KOREAN_HOLIDAYS = { 2021: _2021_js_1.HOLIDAYS_2021, 2022: _2022_js_1.HOLIDAYS_2022, 2023: _2023_js_1.HOLIDAYS_2023, + 2024: _2024_js_1.HOLIDAYS_2024, }; var fallback_js_1 = require("./fallback.js"); Object.defineProperty(exports, "HOLIDAYS_FALLBACK", { enumerable: true, get: function () { return fallback_js_1.HOLIDAYS_FALLBACK; } }); diff --git a/lib/esm/year_holidays/2024.d.ts b/lib/esm/year_holidays/2024.d.ts new file mode 100644 index 0000000..d9eb394 --- /dev/null +++ b/lib/esm/year_holidays/2024.d.ts @@ -0,0 +1,2 @@ +import { IYearHolidays } from './types.js'; +export declare const HOLIDAYS_2024: IYearHolidays; diff --git a/lib/esm/year_holidays/2024.js b/lib/esm/year_holidays/2024.js new file mode 100644 index 0000000..d9b3fcb --- /dev/null +++ b/lib/esm/year_holidays/2024.js @@ -0,0 +1,43 @@ +export var HOLIDAYS_2024 = { + 1: { + 1: true, // 새해 + }, + 2: { + 9: true, // 설날 연휴 + 10: true, // 설날 + 11: true, // 설날 연휴 + 12: true, // 대체공휴일 + }, + 3: { + 1: true, // 삼일절 + }, + 4: { + 10: true, // 22대 국회의원 선거 + }, + 5: { + 1: true, // 근로자의 날 + 5: true, // 어린이날 + 6: true, // 어린이날 대체공휴일 + 15: true, // 부처님 오신날 + }, + 6: { + 6: true, // 현충일 + }, + 7: {}, + 8: { + 15: true, // 광복절 + }, + 9: { + 16: true, // 추석 연휴 + 17: true, // 추석 + 18: true, // 추석 연휴 + }, + 10: { + 3: true, // 개천절 + 9: true, // 한글날 + }, + 11: {}, + 12: { + 25: true, // 성탄절 + }, +}; diff --git a/lib/esm/year_holidays/index.js b/lib/esm/year_holidays/index.js index 5e594dc..1bfe9cf 100644 --- a/lib/esm/year_holidays/index.js +++ b/lib/esm/year_holidays/index.js @@ -3,6 +3,7 @@ import { HOLIDAYS_2020 } from './2020.js'; import { HOLIDAYS_2021 } from './2021.js'; import { HOLIDAYS_2022 } from './2022.js'; import { HOLIDAYS_2023 } from './2023.js'; +import { HOLIDAYS_2024 } from './2024.js'; // 토, 일요일 정보는 포함하지 않음 export var KOREAN_HOLIDAYS = { 2019: HOLIDAYS_2019, @@ -10,5 +11,6 @@ export var KOREAN_HOLIDAYS = { 2021: HOLIDAYS_2021, 2022: HOLIDAYS_2022, 2023: HOLIDAYS_2023, + 2024: HOLIDAYS_2024, }; export { HOLIDAYS_FALLBACK } from './fallback.js'; diff --git a/src/year_holidays/2024.ts b/src/year_holidays/2024.ts new file mode 100644 index 0000000..d663748 --- /dev/null +++ b/src/year_holidays/2024.ts @@ -0,0 +1,45 @@ +import { IYearHolidays } from './types.js'; + +export const HOLIDAYS_2024: IYearHolidays = { + 1: { + 1: true, // 새해 + }, + 2: { + 9: true, // 설날 연휴 + 10: true, // 설날 + 11: true, // 설날 연휴 + 12: true, // 대체공휴일 + }, + 3: { + 1: true, // 삼일절 + }, + 4: { + 10: true, // 22대 국회의원 선거 + }, + 5: { + 1: true, // 근로자의 날 + 5: true, // 어린이날 + 6: true, // 어린이날 대체공휴일 + 15: true, // 부처님 오신날 + }, + 6: { + 6: true, // 현충일 + }, + 7: {}, + 8: { + 15: true, // 광복절 + }, + 9: { + 16: true, // 추석 연휴 + 17: true, // 추석 + 18: true, // 추석 연휴 + }, + 10: { + 3: true, // 개천절 + 9: true, // 한글날 + }, + 11: {}, + 12: { + 25: true, // 성탄절 + }, +}; diff --git a/src/year_holidays/index.ts b/src/year_holidays/index.ts index 3320fce..256a168 100644 --- a/src/year_holidays/index.ts +++ b/src/year_holidays/index.ts @@ -3,6 +3,7 @@ import { HOLIDAYS_2020 } from './2020.js'; import { HOLIDAYS_2021 } from './2021.js'; import { HOLIDAYS_2022 } from './2022.js'; import { HOLIDAYS_2023 } from './2023.js'; +import { HOLIDAYS_2024 } from './2024.js'; import { IYearHolidays } from './types.js'; // 토, 일요일 정보는 포함하지 않음 @@ -12,6 +13,7 @@ export const KOREAN_HOLIDAYS: Record = { 2021: HOLIDAYS_2021, 2022: HOLIDAYS_2022, 2023: HOLIDAYS_2023, + 2024: HOLIDAYS_2024, }; export { HOLIDAYS_FALLBACK } from './fallback.js'; diff --git a/test/getNextKoreanBusinessDayYmd.ts b/test/getNextKoreanBusinessDayYmd.ts index ce0c4ce..4855654 100644 --- a/test/getNextKoreanBusinessDayYmd.ts +++ b/test/getNextKoreanBusinessDayYmd.ts @@ -40,6 +40,11 @@ describe('getNextKoreanBusinessDayYmd', () => { expect(getNextKoreanBusinessDayYmd(20230915, 17)).to.eql(20231017); }); + it('2024', () => { + expect(getNextKoreanBusinessDayYmd(20240430, 4)).to.eql(20240508); + expect(getNextKoreanBusinessDayYmd(20240911, 17)).to.eql(20241011); + }); + it('fallback year', () => { expect(getNextKoreanBusinessDayYmd(20500531, 4)).to.eql(20500607); expect(getNextKoreanBusinessDayYmd(20500915, 17)).to.eql(20501011);