diff options
| author | Jannis Leidel <jannis@leidel.info> | 2009-12-30 22:12:16 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2009-12-30 22:12:16 +0000 |
| commit | fa0653cd1d791a8bce835e8992cbeab6fd70d0e7 (patch) | |
| tree | 413b6cc23aadb51ecf1ac64b7cb2a49bf3d83a71 /django/utils | |
| parent | bf33d3eb1d20157a09b4bf1f36f9c928bc1cabc7 (diff) | |
Fixed #12454 - Added support for localized formats to admin date and time widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils')
| -rw-r--r-- | django/utils/formats.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/utils/formats.py b/django/utils/formats.py index 92e7e7f538..39b4ac2d61 100644 --- a/django/utils/formats.py +++ b/django/utils/formats.py @@ -7,12 +7,12 @@ from django.utils.importlib import import_module from django.utils.encoding import smart_str from django.utils import dateformat, numberformat, datetime_safe -def get_format_modules(): +def get_format_modules(reverse=False): """ Returns an iterator over the format modules found in the project and Django """ modules = [] - if not check_for_language(get_language()): + if not check_for_language(get_language()) or not settings.USE_L10N: return modules locale = to_locale(get_language()) if settings.FORMAT_MODULE_PATH: @@ -30,6 +30,8 @@ def get_format_modules(): # Don't return duplicates if mod not in modules: modules.append(mod) + if reverse: + modules.reverse() return modules def get_format(format_type): |
