Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#19015 closed Bug (fixed)

Slovenian L10N - date field validation does not work for hidden fields

Reported by: bmihelac Owned by: nobody
Component: Internationalization Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When DateInput has HiddenInput widget, it renders value by converting date to string This produces iso-8601 (YYYY-MM-DD) format.

Because iso-8601 format is not stated in slovenian flavor DATE_INPUT_FORMATS, validation will fail if USE_L10N=True and hidden date field exists.

This issue applies to some other locales as well:

ack --py --files-without-matches  '%Y-%m-%d' conf/locale/

Change History (9)

comment:1 by bmihelac, 12 years ago

Summary: Slovenian l10n does not work with hidden fieldsSlovenian L10N - date field validation does not work for hidden fields

comment:2 by bmihelac, 12 years ago

Patch for slovenian language is available:
https://github.com/django/django/pull/390

comment:3 by Claude Paroz, 12 years ago

Component: contrib.localflavorInternationalization
Triage Stage: UnreviewedAccepted

I also think that we should consider adding iso formats by default, then remove them from the formats.py file.

comment:4 by Claude Paroz, 12 years ago

Has patch: set

New pull request which solves the issue by automatically adding ISO input formats to all localized input formats.

https://github.com/django/django/pull/440

comment:5 by bmihelac, 12 years ago

This pull request looks great to me. Agree it is better to implicitly add ISO formats.

comment:6 by Claude Paroz <claude@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 349c4c37f8be401592793b47a591ff079c4a7fbb:

Fixed #19015 -- Add ISO input formats to all formats

comment:7 by Claude Paroz <claude@…>, 11 years ago

In 90d3af380e8efec0301dd91600c6686232de3943:

Fixed #19015 -- Removed ISO formats from localized formats.py

ISO formats are automatically appended to the list of input
formats. Kept only when it is specified in first position, as it
has a special meaning in localize_input.
Thanks Bojan Mihelac for the report.

comment:8 by Claude Paroz <claude@…>, 11 years ago

In ae549cc1dd8740f5463739602967f6595a1b3ce9:

Fixed #19015 -- Removed ISO formats from localized formats.py

ISO formats are automatically appended to the list of input
formats. Kept only when it is specified in first position, as it
has a special meaning in localize_input.
Thanks Bojan Mihelac for the report.

Backport of 90d3af380 from master.

comment:9 by Claude Paroz <claude@…>, 11 years ago

In 1b93499849f497af405de113355681e3af68d50b:

[1.5.x] Fixed #19015 -- Add ISO input formats to all formats

Backport of 349c4c37f8 from master.

Note: See TracTickets for help on using tickets.
Back to Top