Skip to content
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

[Reference][Form Types] Document "with_minutes" time/datetime option #3429

Merged
merged 2 commits into from
Jan 7, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ data can be a ``DateTime`` object, a string, a timestamp or an array.
| | - `years`_ |
| | - `months`_ |
| | - `days`_ |
| | - `with_minutes`_ |
| | - `with_seconds`_ |
| | - `model_timezone`_ |
| | - `view_timezone`_ |
Expand Down Expand Up @@ -109,6 +110,8 @@ for more details.

.. include:: /reference/forms/types/options/days.rst.inc

.. include:: /reference/forms/types/options/with_minutes.rst.inc

.. include:: /reference/forms/types/options/with_seconds.rst.inc

.. include:: /reference/forms/types/options/model_timezone.rst.inc
Expand Down
10 changes: 10 additions & 0 deletions reference/forms/types/options/with_minutes.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
with_minutes
~~~~~~~~~~~~

**type**: ``Boolean`` **default**: ``true``

Whether or not to include minutes in the input. This will result in an additional
input to capture minutes.

.. versionadded:: 2.2
The ``with_minutes`` option was introduced in Symfony 2.2.
Copy link
Member

Choose a reason for hiding this comment

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

this should be placed before the with_minutes headline

Copy link
Member

Choose a reason for hiding this comment

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

We are not really consistent in that but in most cases the versionadded directive is placed below the type line. By the way, do we need it here at all since 2.2 reached EOM?

Copy link
Member

Choose a reason for hiding this comment

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

I 2.3, 2.2 didn't reach EOM. It should be removed in 2.4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, http://symfony.com/doc/current/contributing/documentation/overview.html#documenting-new-features-or-behavior-changes seems to be quite clear about all that. The version note should precede the new/changed feature (currently only valid for one out of six note in the form reference) and version notes are only removed from new doc branches and then only for Symfony version that reached EOL, not EOM. But then you may have to add a version note for a EOL release if you are working on an existing branch like 2.3 and add a missing documention ;-)

17 changes: 14 additions & 3 deletions reference/forms/types/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ as a ``DateTime`` object, a string, a timestamp or an array.
+----------------------+-----------------------------------------------------------------------------+
| Options | - `widget`_ |
| | - `input`_ |
| | - `with_minutes`_ |
| | - `with_seconds`_ |
| | - `hours`_ |
| | - `minutes`_ |
Expand Down Expand Up @@ -83,13 +84,21 @@ widget

The basic way in which this field should be rendered. Can be one of the following:

* ``choice``: renders two (or three if `with_seconds`_ is true) select inputs.
* ``choice``: renders one, two (default) or three select inputs (hour, minute,
second), depending on the `with_minutes`_ and `with_seconds`_ options.

* ``text``: renders a two or three text inputs (hour, minute, second).
* ``text``: renders one, two (default) or three text inputs (hour, minute,
second), depending on the `with_minutes`_ and `with_seconds`_ options.

* ``single_text``: renders a single input of type text. User's input will
* ``single_text``: renders a single input of type ``time``. User's input will
be validated against the form ``hh:mm`` (or ``hh:mm:ss`` if using seconds).

.. caution::

Combining the widget type ``single_text`` and the `with_minutes`_ option
set to ``false`` can cause unexpected behavior in the client as the input
type ``time`` might not support selecting an hour only.

input
~~~~~

Expand All @@ -106,6 +115,8 @@ your underlying object. Valid values are:
The value that comes back from the form will also be normalized back into
this format.

.. include:: /reference/forms/types/options/with_minutes.rst.inc

.. include:: /reference/forms/types/options/with_seconds.rst.inc

.. include:: /reference/forms/types/options/hours.rst.inc
Expand Down