Skip to content

Commit 9016514

Browse files
committed
[reference][forms] adding more details on date format - closes #914
1 parent 3512e05 commit 9016514

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

reference/forms/types/options/date_format.rst.inc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ format
55

66
Option passed to the ``IntlDateFormatter`` class, used to transform user input
77
into the proper format. This is critical when the `widget`_ option is
8-
set to ``single_text``, and will define how to transform the input. By default,
9-
the format is determined based on the current user locale; you can override
10-
it by passing the format as a string.
8+
set to ``single_text``, and will define how the user will input the data.
9+
By default, the format is determined based on the current user locale; you
10+
can override it by passing the format as a string.
11+
12+
For more information on valid formats, see `Date/Time Format Syntax`_. For
13+
example, to render a single text box that expects the user to end ``YYYY-MM-dd``,
14+
use the following options::
15+
16+
$builder->add('date_created', 'date', array(
17+
'widget' => 'single_text',
18+
'format' => 'YYYY-MM-dd',
19+
));
20+
21+
.. _`Date/Time Format Syntax`: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax

0 commit comments

Comments
 (0)