Socket
Socket
Sign inDemoInstall

holiday-kr

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    holiday-kr

한국 기준 음력, 양력 변환 및 휴일 체크


Version published
Weekly downloads
175
decreased by-23.91%
Maintainers
1
Install size
27.9 kB
Created
Weekly downloads
 

Readme

Source
  • 사용 주의사항
    • 1800년 ~ 2101년까지만 가능합니다.

양력, 음력 변환

  • getLunar(Date) or getLunar(year, month, day) : 양력 -> 음력 변환. 결과 : object

    • Date - Date - 날짜 객체(Date)
    • year - number - 년
    • month - number - 월
    • day - number - 일
    holidayKR.getLunar(2016, 1, 1);  
    //{ year: 2015, month: 11, day: 22, leapMonth: false, dayOfWeek: '금' } 
    
    holidayKR.getLunar(new Date(2016, 0, 1));  
    //{ year: 2015, month: 11, day: 22, leapMonth: false, dayOfWeek: '금' }
    
  • getSolar(Date) or getSolar(year, month, day, isLeapMonth) : 음력 -> 양력 변환. 결과 : object

    • Date - Date - 날짜 객체(Date)
    • year - number - 년
    • month - number - 월
    • day - number - 일
    • isLeapMonth - boolean - (option)윤달여부. 기본값 : false
    var holidayKR = require('holiday-kr');
    
    holidayKR.getSolar(2015, 11, 22);  
    //result : { year: 2016, month: 1, day: 1, leapMonth: false, dayOfWeek: '금' }
    
    holidayKR.getSolar(new Date(2015, 10, 22));  
    //result : { year: 2016, month: 1, day: 1, leapMonth: false, dayOfWeek: '금' }
    

한국의 휴일 체크

  • 휴일 기준

    • 일요일
    • 신정 : 양력 1월 1일
    • 설날 : 음력 1월 1일 및 전후
    • 3.1절 : 양력 3월 1일
    • 석가탄신일 : 음력 4월 8일
    • 어린이날 : 양력 5월 5일
    • 현충일 : 양력 6월 6일
    • 광복절 : 양력 8월 15일
    • 추석 : 음력 8월 15일 및 전후
    • 개천절 : 양력 10월 3일
    • 한글날 : 양력 10월 9일
    • 성탄절 : 양력 12월 25일
  • isSolarHoliday(Date) or isSolarHoliday(year, month, day) : 입력된 양력 날짜 기준으로 휴일인지 체크. 휴일 기준은 위 명시된 날만 해당함. 결과 : boolean

    • Date - Date - 날짜 객체(Date)
    • year - number - 년
    • month - number - 월
    • day - number - 일
    var holidayKR = require('holiday-kr');
    
    holidayKR.isSolarHoliday(2016, 1, 1);
    //true
    
    holidayKR.isSolarHoliday(new Date(2016, 0, 2));
    //false
    
  • isLunarHoliday(Date) or isLunarHoliday(year, month, day, isLeapMonth) : 입력된 음력 날짜 기준으로 휴일인지 체크. 휴일 기준은 위 명시된 날만 해당함. 결과 : boolean

    • Date - Date - 날짜 객체(Date)
    • year - number - 년
    • month - number - 월
    • day - number - 일
    • isLeapMonth - boolean - (option)윤달여부. 기본값 : false
    var holidayKR = require('holiday-kr');
    
    holidayKR.isLunarHoliday(2016, 1, 1);
    //true
    
    holidayKR.isLunarHoliday(new Date(2016, 0, 2));
    //true
    

Keywords

FAQs

Last updated on 12 Oct 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc