document DateType limitations #2403

Merged
merged 3 commits into from Mar 31, 2013

Conversation

Projects
None yet
4 participants
Contributor

joelclermont commented Mar 30, 2013

Q A
Doc fix? yes
New docs? yes (symfony/symfony#5227)
Applies to all
Fixed tickets #2266

Relates to Issue 2266. I wasn't sure if it made sense to consolidate this into one note, since the two options are so close, but I kept them separate for now. Feedback welcome.

Member

wouterj commented Mar 30, 2013

Could you please use the pull request format?

And could you also read the rest of that overview document? You're missing some formatting things (and the document doesn't follow the standards)

Contributor

joelclermont commented Mar 30, 2013

Oops, sure thing. Thanks for the quick feedback.

Contributor

joelclermont commented Mar 30, 2013

I added the pull request format to my original comment and broke the lines under 80 characters. I didn't see any other violations. If I missed something, please let me know.

+this format.
+
+Note: If ``timestamp`` is used, ``DateType`` is limited to dates between
@wouterj

wouterj Mar 30, 2013

Member

it should be:

.. note::

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

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

+
+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).
@weaverryan

weaverryan Mar 30, 2013

Member

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!

Member

wouterj commented Mar 30, 2013

👍

Contributor

Sgoettschkes commented Mar 30, 2013

👍

weaverryan added a commit that referenced this pull request Mar 31, 2013

@weaverryan weaverryan merged commit e0ebba8 into symfony:2.0 Mar 31, 2013

Member

weaverryan commented Mar 31, 2013

Top notch Joel - merged!

@joelclermont joelclermont deleted the joelclermont:issue_2266 branch Mar 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment