Skip to content

document DateType limitations #2403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 31, 2013
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion reference/forms/types/options/date_input.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ your underlying object. Valid values are:
* ``timestamp`` (e.g. ``1307232000``)

The value that comes back from the form will also be normalized back into
this format.
this format.

Note: If ``timestamp`` is used, ``DateType`` is limited to dates between
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be:

.. note::

    If ``timestamp`` is used, ...

And maybe change the .. note:: block to a .. caution:: block

Fri, 13 Dec 1901 20:45:54 GMT and Tue, 19 Jan 2038 03:14:07 GMT on 32bit
systems. This is due to a `limitation in PHP itself <http://php.net/manual/en/function.date.php>`_:

The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT
to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond
to the minimum and maximum values for a 32-bit signed integer). However,
before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on
some systems (e.g. Windows).
4 changes: 4 additions & 0 deletions reference/forms/types/options/date_widget.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ The basic way in which this field should be rendered. Can be one of the followin

* ``single_text``: renders a single input of type text. User's input is validated
based on the `format`_ option.

Note: If ``single_text`` is used, ``DateType`` is limited to dates between Fri, 13 Dec 1901 20:45:54 GMT and Tue, 19 Jan 2038 03:14:07 GMT on 32bit systems. This is due to a `limitation in PHP itself <http://php.net/manual/en/function.date.php>`_:

The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer). However, before PHP 5.1.0 this range was limited from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the link you've added to the php.net page. To make this shorter (because it's always a challenge to mention these edge-case details without cluttering things up), how about we:

a) link to http://php.net/manual/en/function.date.php#refsect1-function.date-changelog (so that it goes right down to that note)
b) Omit the note starting with "The valid range of a ....".

And with that, I think I love it!