Skip to content

Commit

Permalink
feat: 2024년 공휴일 정보 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sixmen committed Dec 13, 2023
1 parent 6782247 commit d94ea39
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/cjs/year_holidays/2024.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { IYearHolidays } from './types.js';
export declare const HOLIDAYS_2024: IYearHolidays;
46 changes: 46 additions & 0 deletions lib/cjs/year_holidays/2024.js
Original file line number Diff line number Diff line change
@@ -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, // 성탄절
},
};
2 changes: 2 additions & 0 deletions lib/cjs/year_holidays/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ 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,
2020: _2020_js_1.HOLIDAYS_2020,
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; } });
2 changes: 2 additions & 0 deletions lib/esm/year_holidays/2024.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { IYearHolidays } from './types.js';
export declare const HOLIDAYS_2024: IYearHolidays;
43 changes: 43 additions & 0 deletions lib/esm/year_holidays/2024.js
Original file line number Diff line number Diff line change
@@ -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, // 성탄절
},
};
2 changes: 2 additions & 0 deletions lib/esm/year_holidays/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ 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,
2020: HOLIDAYS_2020,
2021: HOLIDAYS_2021,
2022: HOLIDAYS_2022,
2023: HOLIDAYS_2023,
2024: HOLIDAYS_2024,
};
export { HOLIDAYS_FALLBACK } from './fallback.js';
45 changes: 45 additions & 0 deletions src/year_holidays/2024.ts
Original file line number Diff line number Diff line change
@@ -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, // 성탄절
},
};
2 changes: 2 additions & 0 deletions src/year_holidays/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

// 토, 일요일 정보는 포함하지 않음
Expand All @@ -12,6 +13,7 @@ export const KOREAN_HOLIDAYS: Record<number, IYearHolidays | undefined> = {
2021: HOLIDAYS_2021,
2022: HOLIDAYS_2022,
2023: HOLIDAYS_2023,
2024: HOLIDAYS_2024,
};

export { HOLIDAYS_FALLBACK } from './fallback.js';
5 changes: 5 additions & 0 deletions test/getNextKoreanBusinessDayYmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d94ea39

Please sign in to comment.