mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #20986 -- Enabled SelectDateWidget to use custom months
Reviewed by Trac alias MarkusH.
This commit is contained in:
parent
b89c2a5d9e
commit
da800be6dd
4 changed files with 98 additions and 6 deletions
|
@ -763,3 +763,20 @@ Composite widgets
|
|||
|
||||
An optional list/tuple of years to use in the "year" select box.
|
||||
The default is a list containing the current year and the next 9 years.
|
||||
|
||||
.. attribute:: SelectDateWidget.months
|
||||
|
||||
.. versionadded:: 1.7
|
||||
|
||||
An optional dict of months to use in the "months" select box.
|
||||
|
||||
The keys of the dict correspond to the month number (1-indexed) and
|
||||
the values are the displayed months.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
MONTHS = {
|
||||
1:_('jan'), 2:_('feb'), 3:_('mar'), 4:_('apr'),
|
||||
5:_('may'), 6:_('jun'), 7:_('jul'), 8:_('aug'),
|
||||
9:_('sep'), 10:_('oct'), 11:_('nov'), 12:_('dec')
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue