haskell-github-trust / thyme

A faster date and time library based on time
BSD 3-Clause "New" or "Revised" License
46 stars 33 forks source link

Bug in weekdayOfMonth? #7

Closed soapie closed 11 years ago

soapie commented 11 years ago
> YearMonthDay 2013 10 1^.from gregorian.weekdayOfMonth
WeekdayOfMonth {womYear = 2013, womMonth = 10, womNth = 0, womDayOfWeek = 2}

> weekdayOfMonthValid (YearMonthDay 2013 10 1^.from gregorian.weekdayOfMonth)
Nothing

> YearMonthDay 2013 10 8^.from gregorian.weekdayOfMonth
WeekdayOfMonth {womYear = 2013, womMonth = 10, womNth = 1, womDayOfWeek = 2}

> weekdayOfMonthValid (YearMonthDay 2013 10 8^.from gregorian.weekdayOfMonth)
Just 2013-10-01

> YearMonthDay 2013 10 8^.from gregorian.weekdayOfMonth.from weekdayOfMonth
2013-10-01

toWeekday seems to put womNth in the wrong range -- 0-4 rather than 1-5.