Opened 13 years ago
Closed 13 years ago
#16349 closed Bug (fixed)
Wrong date input format for Brazilian localization
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | 1.3 |
Severity: | Normal | Keywords: | l10n, pt-br |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Attachments (3)
Change History (12)
by , 13 years ago
Attachment: | date-input-pt-br.patch added |
---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Instead take it out we can just change the order. I see many persons writing yours own format.py to use the Brazilian standard.
comment:3 by , 13 years ago
Patch needs improvement: | set |
---|
Yes, that's a good idea.
The first item in DATE_INPUT_FORMATS
is used to display the current value in form fields when the field has no format
attribute. If I understand correctly, this is why you want to change DATE_INPUT_FORMATS
. Re-ordering the formats resolves this issue without affecting form submission.
Can you submit a new patch?
comment:4 by , 13 years ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 13 years ago
Yep, I wish change just to show the date in the correct standard. Doesn't make sense take out %Y-%m-%d
... :-D
I will submit the new patch asap.
comment:7 by , 13 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:8 by , 13 years ago
Those patches are still incomplete. DATE_FORMAT and DATETIME_FORMAT remain incorrect. They should use "F", instead of "N", for month names,
DATE_FORMAT = r'j \de F \de Y' DATETIME_FORMAT = r'j \de F \de Y à\s H:i'
See http://en.wikipedia.org/wiki/Date_and_time_notation_in_Brazil. Also see django.conf.locale.pt.formats, the European Portuguese module, which already use those formats. In Brazil, month names are not abbreviated.
Basically, this patch means that
%Y-%m-%d
will no longer be accepted in submitted forms. This is backwards incompatible: some people may rely on this format being accepted, for instance if they use calendar widgets in Javascript that produce such a value. I don't think%Y-%m-%d
is ambiguous in any language, so it can't hurt to keep it.For this reason, I vote -1, but I'd like another opinion before rejecting the patch.