korea-holidays 0.1.0.1 → 0.1.0.2
raw patch · 4 files changed
+54/−14 lines, 4 files
Files
- README.md +13/−9
- data/ko_holidays.yaml +35/−0
- korea-holidays.cabal +4/−3
- test/Data/Holiday/KoreaSpec.hs +2/−2
README.md view
@@ -1,19 +1,24 @@ # korea-holidays [](https://travis-ci.com/kkweon/korea-holidays)++ -*korea-holidays* is a Haskell library to check if a given date is a Korean+**korea-holidays** is a Haskell library to check if a given date is a Korean Holiday. ## Usage ```haskell-import qualified Data.Holiday.Korea as Korea+Korea.getHoliday 2000 1 1 `shouldBe`+ Just+ Holiday+ {date = KM.MD (1, 1), name = "New Year's Day", lunar = Nothing} -Korea.getHoliday 2000 1 1 `shouldBe` Just Korea.Holiday- { Korea.date = Korea.MD (1, 1)- , Korea.name = "SinJeong"- }+Korea.getHoliday 2019 3 1 `shouldBe`+ Just+ Holiday+ {date = KM.MD (3, 1), name = "March 1 Movement Day", lunar = Nothing} ``` ## Add to your dependency@@ -21,7 +26,6 @@ In your `package.yaml` ```yaml-library:- dependencies:- - korea-holidays+dependencies:+- korea-holidays ```
+ data/ko_holidays.yaml view
@@ -0,0 +1,35 @@+- name: "New Year's Day"+ date: 1-1++- name: "Korean New Year"+ date: 1-1+ lunar: true++- name: "March 1 Movement Day"+ date: 3-1++- name: "Children's Day"+ date: 5-5++- name: "Buddha's Birthday"+ date: 4-8+ lunar: true++- name: "Memorial Day"+ date: 6-6++- name: "National Liberation Day"+ date: 8-15++- name: "Chuseok"+ date: 8-15+ lunar: true++- name: "National Foundation Day"+ date: 10-3++- name: "Hangul Day"+ date: 10-9++- name: "Christmas"+ date: 12-25
korea-holidays.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 1899fbd340797c524a7249df5ae2dbd9506d0422a32f92fb73ca22da544c8128+-- hash: f801a997f4d1d6b8a9921d6b1d40602714658b584df43c2d9d7b078a87264249 name: korea-holidays-version: 0.1.0.1+version: 0.1.0.2 synopsis: Korea Holidays description: Please see the README on GitHub at <https://github.com/kkweon/korea-holidays#readme> category: Time@@ -22,7 +22,8 @@ extra-source-files: README.md ChangeLog.md-data-dir: data+data-files:+ data/ko_holidays.yaml source-repository head type: git
test/Data/Holiday/KoreaSpec.hs view
@@ -8,12 +8,12 @@ spec :: Spec spec = describe "Data.Holiday.Korea" $ do- it "returns a SinJeong when xxxx/1/1" $+ it "returns New Year's Day when 2000/1/1" $ Korea.getHoliday 2000 1 1 `shouldBe` Just KM.Holiday {date = KM.MD (1, 1), name = "New Year's Day", lunar = Nothing}- it "returns the Independence Movement Day 3/1" $+ it "returns March 1 Movement Day when 2019/3/1" $ Korea.getHoliday 2019 3 1 `shouldBe` Just KM.Holiday