@bbodek/holidays
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@bbodek/holidays

Usage

import { PUBLIC_HOLIDAYS, isHoliday } from '@bbodek/holidays';
const { PUBLIC_HOLIDAYS, isHoliday } = require('@bbodek/holidays'); // CJS Support

API Specification

isHoliday(date: Date): boolean

import { isHoliday } from '@bbodek/holidays';

console.log(isHoliday(new Date('2024-01-01T00:00:00.000+09:00'))); // true
console.log(isHoliday(new Date('2023-12-31T15:00:00.000Z'))); // true
console.log(isHoliday(new Date('2024-01-02T00:00:00.000+09:00'))); // false

PUBLIC_HOLIDAYS: { date: string; name: string }[]

import { PUBLIC_HOLIDAYS } from '@bbodek/holidays';

console.log(PUBLIC_HOLIDAYS); // [{ date: '2024-01-01', name: '새해 첫날' } ...

Sync holidays

[!NOTE] 법정 공휴일과 대체 공휴일은 우주항공청에서 관보에 게재하는 월력요항에 따라 매년 6월 말에 다음 연도를 추가해야 함.1
임시 공휴일은 연중 추가될 수 있기 때문에 국무회의 의결로 확정될 때 대응해야 함.2

  1. 공휴일에 관한 법률 제2조, 관공서의 공휴일에 관한 규정 제3조, 천문법 제5조 제3항, 천문법 시행령 제3조

  2. 관공서의 공휴일에 관현 규정 제4조

Package Sidebar

Install

npm i @bbodek/holidays

Weekly Downloads

43

Version

1.0.3

License

MIT

Unpacked Size

20.5 kB

Total Files

9

Last publish

Collaborators

  • thebbodek