[Django] #30990: Documentation error for `z` date format

7 views
Skip to first unread message

Django

unread,
Nov 15, 2019, 5:01:03 PM11/15/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
---------------------------------------------+------------------------
Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
The documentation for the `z` [date
format](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date)
states that its output ranges from "0 to 365".

This is actually incorrect and the range is 1-366 (January 1st is 1 and
December 31st is 365 or 366 depending on whether it's a leap year or not).

While digging there, I also noticed that the implementations of the `z`
and `W` formats seemed to just reimplement code that it already in
Python's standard library so I added some commits to the pull request to
simplify that a bit.

--
Ticket URL: <https://code.djangoproject.com/ticket/30990>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 15, 2019, 5:09:46 PM11/15/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-----------------------------------+--------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by Baptiste Mispelon:

Old description:

> The documentation for the `z` [date
> format](https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date)
> states that its output ranges from "0 to 365".
>
> This is actually incorrect and the range is 1-366 (January 1st is 1 and
> December 31st is 365 or 366 depending on whether it's a leap year or
> not).
>
> While digging there, I also noticed that the implementations of the `z`
> and `W` formats seemed to just reimplement code that it already in
> Python's standard library so I added some commits to the pull request to
> simplify that a bit.

New description:

The documentation for the `z`

[https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date date
format] states that its output ranges from "0 to 365".

This is actually incorrect and the range is 1-366 (January 1st is 1 and
December 31st is 365 or 366 depending on whether it's a leap year or not).

While digging there, I also noticed that the implementations of the `z`
and `W` formats seemed to just reimplement code that it already in
Python's standard library so I added some commits to the pull request to
simplify that a bit.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:1>

Django

unread,
Nov 16, 2019, 2:52:36 AM11/16/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-----------------------------------+--------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------

Comment (by Claude Paroz):

[https://github.com/django/django/pull/12076 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:2>

Django

unread,
Nov 16, 2019, 2:54:06 AM11/16/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-----------------------------------+------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Claude Paroz):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:3>

Django

unread,
Nov 17, 2019, 8:39:51 PM11/17/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by zhou_wuji):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:4>

Django

unread,
Nov 18, 2019, 6:04:52 AM11/18/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"1185c6172b4dd5482b7bc76b12d7a0588320e027" 1185c617]:
{{{
#!CommitTicketReference repository=""
revision="1185c6172b4dd5482b7bc76b12d7a0588320e027"
Fixed #30990 -- Fixed example output in 'z' date format docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:6>

Django

unread,
Nov 18, 2019, 6:04:52 AM11/18/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"18e10740a43d3d6f70a85af6fdf3bb90bdbd1183" 18e10740]:
{{{
#!CommitTicketReference repository=""
revision="18e10740a43d3d6f70a85af6fdf3bb90bdbd1183"
Refs #30990 -- Added test for 'z' date format with a leap year.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:5>

Django

unread,
Nov 18, 2019, 6:05:22 AM11/18/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"1c75af9090a955339658d790fdcf9117e2989fbb" 1c75af9]:
{{{
#!CommitTicketReference repository=""
revision="1c75af9090a955339658d790fdcf9117e2989fbb"
[3.0.x] Fixed #30990 -- Fixed example output in 'z' date format docs.

Backport of 1185c6172b4dd5482b7bc76b12d7a0588320e027 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:7>

Django

unread,
Nov 18, 2019, 6:05:43 AM11/18/19
to django-...@googlegroups.com
#30990: Documentation error for `z` date format
-------------------------------------+-------------------------------------

Reporter: Baptiste Mispelon | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"d5e8ad004913bc5aa9925b997154d5ef8bcb81cd" d5e8ad00]:
{{{
#!CommitTicketReference repository=""
revision="d5e8ad004913bc5aa9925b997154d5ef8bcb81cd"
[2.2.x] Fixed #30990 -- Fixed example output in 'z' date format docs.

Backport of 1185c6172b4dd5482b7bc76b12d7a0588320e027 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30990#comment:8>

Reply all
Reply to author
Forward
0 new messages