diff options
Diffstat (limited to 'babel/dates.py')
-rw-r--r-- | babel/dates.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/babel/dates.py b/babel/dates.py index ec86991..f1bd66f 100644 --- a/babel/dates.py +++ b/babel/dates.py @@ -12,7 +12,7 @@ * ``LC_ALL``, and * ``LANG`` - :copyright: (c) 2013-2018 by the Babel Team. + :copyright: (c) 2013-2019 by the Babel Team. :license: BSD, see LICENSE for more details. """ @@ -1506,12 +1506,12 @@ class DateTimeFormat(object): if 7 - first_day >= self.locale.min_week_days: week_number += 1 - + if self.locale.first_week_day == 0: - # Correct the weeknumber in case of iso-calendar usage (first_week_day=0). + # Correct the weeknumber in case of iso-calendar usage (first_week_day=0). # If the weeknumber exceeds the maximum number of weeks for the given year - # we must count from zero.For example the above calculation gives week 53 - # for 2018-12-31. By iso-calender definition 2018 has a max of 52 + # we must count from zero.For example the above calculation gives week 53 + # for 2018-12-31. By iso-calender definition 2018 has a max of 52 # weeks, thus the weeknumber must be 53-52=1. max_weeks = date(year=self.value.year, day=28, month=12).isocalendar()[1] if week_number > max_weeks: |