Fixed a bug with dates and week numbers

Week numbers were broken for the turn of the year if the last day of
the year is a sunday.