quinnj / Datetime.jl

A Date and DateTime implementation for Julia; Now deprecated in favor of https://github.com/quinnj/Dates.jl
Other
20 stars 15 forks source link

Datetime.Sunday does not match Sunday returned in dayofweek #52

Closed john32979 closed 10 years ago

john32979 commented 10 years ago

julia> Datetime.dayofweek(Datetime.date("2014-02-02")) 0

julia> Datetime.Sunday 7

Looks like the problem is here:

dayofweek(dt::DateTimeDate) = (_days(dt) % 7) ... const Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday = 1,2,3,4,5,6,7

Either Datetime.dayofweek should return 7 rather than 0 for Sunday or Datetime.Sunday should be set to 0.