The documentation (
https://docs.djangoproject.com/en/5.0/ref/forms/fields/#timefield) says
that " the default input formats are taken from the active locale format
TIME_INPUT_FORMATS key, or from TIME_INPUT_FORMATS
<https://docs.djangoproject.com/en/5.0/ref/settings/#std-setting-TIME_INPUT_FORMATS>
if localization is disabled". However, neither my reading of the code, or
my actual experience shows settings.TIME_INPUT_FORMATS ever being used,
even with "USE_I18N = False"

TimeField gets the formats from `input_formats =
formats.get_format_lazy("TIME_INPUT_FORMATS")` which is a lazy version of
`formats.get_format` -- the documentation of which says "If use_l10n is
provided and is not None, it forces the value to be localized (or not),
otherwise it's always localized."

so even with "USE_I18N = False" settings.TIME_INPUT_FORMATS seems to be
ignored.

How does one use settings.TIME_INPUT_FORMATS ?

Arthur Pemberton

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CA%2BX4dQRAjfSJnAK9iZ%3DhJMkN%2BTfoShX6%2BNRsjM0oMF6jGDSuZg%40mail.gmail.com.
  • Use... Arthur Pemberton
    • ... David Sanders
      • ... Arthur Pemberton
        • ... 'Adam Johnson' via Django developers (Contributions to Django itself)
          • ... Arthur Pemberton
            • ... Natraj Kavander
          • ... Arthur Pemberton
            • ... Arthur Pemberton
              • ... Arthur Pemberton
          • ... Arthur Pemberton
            • ... zaw naing

Reply via email to