From b0aefa8c6c1fb566827d6bc1f0aeecf344c6498d Mon Sep 17 00:00:00 2001 From: Shim Won Date: Fri, 7 Apr 2017 09:05:27 +0900 Subject: [PATCH 1/2] Update Korean holiday - Korean New Year is 3 days - Use Korean language --- kr.yaml | 66 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/kr.yaml b/kr.yaml index 539fc33..6ea56cc 100644 --- a/kr.yaml +++ b/kr.yaml @@ -1,75 +1,91 @@ # Republic of Korea holiday definitions for the Ruby Holiday gem. # Provided by Jonathan Pike # -# Updated: 2017-02-23. +# Updated: 2017-04-27. # Sources: # - https://en.wikipedia.org/wiki/List_of_public_holidays_in_South_Korea # - http://www.hko.gov.hk/gts/time/conversion.htm (for Lunar Calendar Conversions) +# +# For Korean/English translations of each holiday: +# - https://ko.wikipedia.org/wiki/%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD%EC%9D%98_%EA%B3%B5%ED%9C%B4%EC%9D%BC +# --- months: 1: - - name: Korean New Year + - name: 설날 regions: [kr] function: lunar_to_solar(year, month, day, region) mday: 1 - - name: New Year's Day + - name: 설날 연휴 + regions: [kr] + function: lunar_to_solar(year, month, day) + mday: 2 + - name: 신정 regions: [kr] mday: 1 3: - - name: Independence Movement Day + - name: 3·1절 regions: [kr] mday: 1 4: - - name: Buddah's Birthday + - name: 석가탄신일 regions: [kr] function: lunar_to_solar(year, month, day, region) mday: 8 5: - - name: Children's Day + - name: 어린이날 regions: [kr] mday: 5 6: - - name: Memorial Day + - name: 현충일 regions: [kr] mday: 6 7: - - name: Constitution Day + - name: 제헌절 regions: [kr] mday: 17 type: informal 8: - - name: Korean Thanksgiving + - name: 추석 regions: [kr] function: lunar_to_solar(year, month, day, region) mday: 15 - - name: Liberation Day + - name: 광복절 regions: [kr] mday: 15 10: - - name: National Foundation Day + - name: 개천절 regions: [kr] mday: 3 - - name: Hangul Day + - name: 한글날 regions: [kr] mday: 9 12: - - name: Christmas Day + - name: 크리스마스 regions: [kr] mday: 25 + - name: 설날 연휴 + regions: [kr] + function: lunar_to_solar(year, month, day) + mday: 29 tests: | - {Date.civil(2016,2,8) => "Korean New Year", - Date.civil(2016,5,14) => "Buddah\'s Birthday", - Date.civil(2016,9,15) => "Korean Thanksgiving", - Date.civil(2016,1,1) => "New Year\'s Day", - Date.civil(2016,3,1) => "Independence Movement Day", - Date.civil(2016,5,5) => "Children\'s Day", - Date.civil(2016,6,6) => "Memorial Day", - Date.civil(2016,7,17) => "Constitution Day", - Date.civil(2016,8,15) => "Liberation Day", - Date.civil(2016,10,3) => "National Foundation Day", - Date.civil(2016,10,9) => "Hangul Day", - Date.civil(2016,12,25) => "Christmas Day"}.each do |date, name| + {Date.civil(2016,2,8) => "설날", + Date.civil(2017,2,9) => "설날 연휴", + Date.civil(2016,5,14) => "석가탄신일", + Date.civil(2016,9,15) => "추석", + Date.civil(2016,1,1) => "신정", + Date.civil(2016,3,1) => "3·1절", + Date.civil(2016,5,5) => "어린이날", + Date.civil(2016,6,6) => "현충일", + Date.civil(2016,7,17) => "제헌절", + Date.civil(2016,8,15) => "광복절", + Date.civil(2016,10,3) => "개천절", + Date.civil(2016,10,9) => "한글날", + Date.civil(2016,12,25) => "크리스마스", + Date.civil(2017,1,27) => "설날 연휴", + Date.civil(2017,1,28) => "설날" + }.each do |date, name| assert_equal name, (Holidays.on(date, :kr, :informal)[0] || {})[:name] end From 0d394d1576ffa859ceb528025743f7a99b8c09e0 Mon Sep 17 00:00:00 2001 From: Shim Won Date: Sat, 8 Apr 2017 15:56:38 +0900 Subject: [PATCH 2/2] Add region specification ref #32 --- kr.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kr.yaml b/kr.yaml index 6ea56cc..5aedc4e 100644 --- a/kr.yaml +++ b/kr.yaml @@ -19,7 +19,7 @@ months: mday: 1 - name: 설날 연휴 regions: [kr] - function: lunar_to_solar(year, month, day) + function: lunar_to_solar(year, month, day, region) mday: 2 - name: 신정 regions: [kr] @@ -67,7 +67,7 @@ months: mday: 25 - name: 설날 연휴 regions: [kr] - function: lunar_to_solar(year, month, day) + function: lunar_to_solar(year, month, day, region) mday: 29 tests: |