From 1c75af9090a955339658d790fdcf9117e2989fbb Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 15 Nov 2019 17:28:48 +0100 Subject: [PATCH] [3.0.x] Fixed #30990 -- Fixed example output in 'z' date format docs. Backport of 1185c6172b4dd5482b7bc76b12d7a0588320e027 from master --- django/utils/dateformat.py | 2 +- docs/ref/templates/builtins.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index d3f586aacf..29893fe6b9 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -348,7 +348,7 @@ class DateFormat(TimeFormat): return self.data.year def z(self): - "Day of the year; i.e. '0' to '365'" + """Day of the year, i.e. 1 to 366.""" doy = self.year_days[self.data.month] + self.data.day if self.L() and self.data.month > 2: doy += 1 diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index b5ebff2b73..80eb799994 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1352,7 +1352,7 @@ Format character Description Example output month, 2 characters. ``w`` Day of the week, digits without ``'0'`` (Sunday) to ``'6'`` (Saturday) leading zeros. -``z`` Day of the year. ``0`` to ``365`` +``z`` Day of the year. ``1`` to ``366`` **Week** ``W`` ISO-8601 week number of year, with ``1``, ``53`` weeks starting on Monday.