bank-holiday-usa 0.1.0 → 0.1.1
raw patch · 3 files changed
+18/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/Time/Calendar/BankHoliday/UnitedStates.hs +2/−3
- bank-holiday-usa.cabal +1/−1
- test/Data/Time/Calendar/BankHoliday/UnitedStatesSpec.hs +15/−1
Data/Time/Calendar/BankHoliday/UnitedStates.hs view
@@ -23,15 +23,14 @@ [jan, feb, jun, jul, sep, oct, nov, dec] = monthsMap monthsMap = map (fromGregorian year) [1,2,6,7,9,10,11,12] standardHolidays = [- 2 `weeksBefore` firstMondayIn feb -- mlk Day+ 2 `weeksAfter` firstMondayIn jan -- mlk Day , 2 `weeksAfter` firstMondayIn feb -- presidents day , weekBefore (firstMondayIn jun) -- memorial day , firstMondayIn sep -- labor day , weekAfter (firstMondayIn oct) -- columbusDay- , 3 `weeksAfter` firstThursdayIn nov -- thanksgiving+ , 2 `weeksAfter` firstThursdayIn nov -- thanksgiving ] ++ catMaybes [ weekendHolidayFrom (jan 1) -- newYearsDay- , weekendHolidayFrom (jan 20) -- inaugurationDay , weekendHolidayFrom (jul 4) -- independenceDay , weekendHolidayFrom (nov 11) -- veteransDay , weekendHolidayFrom (dec 25) -- christmas
bank-holiday-usa.cabal view
@@ -1,5 +1,5 @@ name: bank-holiday-usa-version: 0.1.0+version: 0.1.1 cabal-version: >=1.10 build-type: Simple license: MIT
test/Data/Time/Calendar/BankHoliday/UnitedStatesSpec.hs view
@@ -2,7 +2,7 @@ module Data.Time.Calendar.BankHoliday.UnitedStatesSpec (spec) where -import Data.List (nub)+import Data.List (nub, sort) import Data.Time import Test.Hspec import Test.QuickCheck@@ -15,6 +15,20 @@ describe "bankHolidays" $ do it "are always a weekday" $ property $ \yr -> all (\d -> isWeekday d) (bankHolidays yr)++ it "gets all dates in 2017 correct" $ do+ let year = fromGregorian 2017+ let dates = [ year 1 2+ , year 1 16+ , year 2 20+ , year 5 29+ , year 7 4+ , year 9 4+ , year 10 9+ , year 11 23+ , year 12 25+ ]+ (sort (bankHolidays 2017)) `shouldBe` dates it "do not include dates before the inception of bank holidays" $ do (bankHolidays 1932) `shouldBe` []