From 8cfb85095878f51dea0dfdbca59bf21e1c15a399 Mon Sep 17 00:00:00 2001
From: Philipp Rieber
Date: Mon, 6 Jan 2014 08:01:37 +0100
Subject: [PATCH 1/2] [Reference][Form Types] Document "with_minutes"
time/datetime option
---
reference/forms/types/datetime.rst | 3 +++
.../forms/types/options/with_minutes.rst.inc | 10 ++++++++++
reference/forms/types/time.rst | 17 ++++++++++++++---
3 files changed, 27 insertions(+), 3 deletions(-)
create mode 100644 reference/forms/types/options/with_minutes.rst.inc
diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst
index e607655f03e..5db418b44f3 100644
--- a/reference/forms/types/datetime.rst
+++ b/reference/forms/types/datetime.rst
@@ -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`_ |
@@ -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
diff --git a/reference/forms/types/options/with_minutes.rst.inc b/reference/forms/types/options/with_minutes.rst.inc
new file mode 100644
index 00000000000..f2c7a79c02c
--- /dev/null
+++ b/reference/forms/types/options/with_minutes.rst.inc
@@ -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.
diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst
index 4a203498615..49a40782ae5 100644
--- a/reference/forms/types/time.rst
+++ b/reference/forms/types/time.rst
@@ -17,6 +17,7 @@ as a ``DateTime`` object, a string, a timestamp or an array.
+----------------------+-----------------------------------------------------------------------------+
| Options | - `widget`_ |
| | - `input`_ |
+| | - `with_minutes`_ |
| | - `with_seconds`_ |
| | - `hours`_ |
| | - `minutes`_ |
@@ -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
~~~~~
@@ -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
From 1e88b9decb626e91f99990b3440cbaa96c46cbda Mon Sep 17 00:00:00 2001
From: Philipp Rieber
Date: Mon, 6 Jan 2014 15:40:38 +0100
Subject: [PATCH 2/2] Fix "versionadded" position
---
reference/forms/types/options/with_minutes.rst.inc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/reference/forms/types/options/with_minutes.rst.inc b/reference/forms/types/options/with_minutes.rst.inc
index f2c7a79c02c..274509e0b83 100644
--- a/reference/forms/types/options/with_minutes.rst.inc
+++ b/reference/forms/types/options/with_minutes.rst.inc
@@ -1,3 +1,6 @@
+.. versionadded:: 2.2
+ The ``with_minutes`` option was introduced in Symfony 2.2.
+
with_minutes
~~~~~~~~~~~~
@@ -5,6 +8,3 @@ with_minutes
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.