Thanks, I'll look into that. But does that mean that settings.TIME_INPUT_FORMATS no longer has any use? I don't see any logic flows that lead to it being used.
On Tue, Mar 5, 2024 at 3:00 AM David Sanders <shang.xiao.sand...@gmail.com> wrote: > Define TIME_INPUT_FORMATS in your local formats.py setup as per: > https://docs.djangoproject.com/en/5.0/topics/i18n/formatting/#creating-custom-format-files > > On Tue, 5 Mar 2024 at 18:43, Arthur Pemberton <pemb...@gmail.com> wrote: > >> 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 >> <https://groups.google.com/d/msgid/django-developers/CA%2BX4dQRAjfSJnAK9iZ%3DhJMkN%2BTfoShX6%2BNRsjM0oMF6jGDSuZg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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/CADyZw-5Vb6K4HQjVbcr1aQGCdozoHkA%2B2Q4Vczp8L63ROX%2BDtQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-developers/CADyZw-5Vb6K4HQjVbcr1aQGCdozoHkA%2B2Q4Vczp8L63ROX%2BDtQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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%2BX4dQTQwnqe%3DpJf3bmiZH5LHJ87df%2B8-Rq5LbpLcctp9jNfjA%40mail.gmail.com.