diff options
| author | Karen Tracey <kmtracey@gmail.com> | 2009-03-22 16:13:06 +0000 |
|---|---|---|
| committer | Karen Tracey <kmtracey@gmail.com> | 2009-03-22 16:13:06 +0000 |
| commit | 14b160957e2965669e241f4640dd42a0fc412ec4 (patch) | |
| tree | 9069f7bb839ca154f851515ad3e08b86841c03b3 /docs/ref/forms/widgets.txt | |
| parent | b203db6ec850fee9ad8f2e2c8873be986325572b (diff) | |
Fixed #8962 -- Consistently support format and input_format in the various (individual, combined, split) date and time form fields and widgets.
Many thanks to Tai Lee for doing all the work here.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/forms/widgets.txt')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 364e664fc1..232a2acf0b 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -36,12 +36,49 @@ commonly used groups of widgets: File upload input: ``<input type='file' ...>`` +.. class:: DateInput + + .. versionadded:: 1.1 + + Date input as a simple text box: ``<input type='text' ...>`` + + Takes one optional argument: + + .. attribute:: DateInput.format + + The format in which this field's initial value will be displayed. + + If no ``format`` argument is provided, the default format is ``'%Y-%m-%d'``. + .. class:: DateTimeInput .. versionadded:: 1.0 Date/time input as a simple text box: ``<input type='text' ...>`` + Takes one optional argument: + + .. attribute:: DateTimeInput.format + + The format in which this field's initial value will be displayed. + + If no ``format`` argument is provided, the default format is ``'%Y-%m-%d %H:%M:%S'``. + +.. class:: TimeInput + + Time input as a simple text box: ``<input type='text' ...>`` + + Takes one optional argument: + + .. attribute:: TimeInput.format + + The format in which this field's initial value will be displayed. + + If no ``format`` argument is provided, the default format is ``'%H:%M:%S'``. + + .. versionchanged:: 1.1 + The ``format`` argument was not supported in Django 1.0. + .. class:: Textarea Text area: ``<textarea>...</textarea>`` @@ -91,8 +128,15 @@ commonly used groups of widgets: .. class:: SplitDateTimeWidget - Wrapper around two ``TextInput`` widgets: one for the date, and one for the - time. + Wrapper around two widgets: ``DateInput`` for the date, and ``TimeInput`` + for the time. + + Takes two optional arguments, ``date_format`` and ``time_format``, which + work just like the ``format`` argument for ``DateInput`` and ``TimeInput``. + + .. versionchanged:: 1.1 + The ``date_format`` and ``time_format`` arguments were not supported in Django 1.0. + Specifying widgets ------------------ |
