summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2019-11-15 17:28:48 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-18 12:04:51 +0100
commitd5e8ad004913bc5aa9925b997154d5ef8bcb81cd (patch)
tree3588f63a8f8bfa71b312e9dfe062d579f9f7f35c
parent622158b371ade0e76e84d93ce18fc8caef911d22 (diff)
[2.2.x] Fixed #30990 -- Fixed example output in 'z' date format docs.
Backport of 1185c6172b4dd5482b7bc76b12d7a0588320e027 from master
-rw-r--r--django/utils/dateformat.py2
-rw-r--r--docs/ref/templates/builtins.txt2
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 8a8514914e..f33b52e5d4 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.