Opened 13 years ago

Closed 13 years ago

#16349 closed Bug (fixed)

Wrong date input format for Brazilian localization

Reported by: semente+django@… 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)

date-input-pt-br.patch (728 bytes ) - added by Guiljerme Gondim <semente+django@…> 13 years ago.
16349-patch.diff (754 bytes ) - added by Guilherme Gondim 13 years ago.
Better one.
16349-2.diff (1.2 KB ) - added by Claude Paroz 13 years ago.
Same with DATE_FORMAT/DATETIME_FORMAT also fixed

Download all attachments as: .zip

Change History (12)

by Guiljerme Gondim <semente+django@…>, 13 years ago

Attachment: date-input-pt-br.patch added

comment:1 by Aymeric Augustin, 13 years ago

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.

comment:2 by Guilherme Gondim, 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 Aymeric Augustin, 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 Aymeric Augustin, 13 years ago

Easy pickings: set
Triage Stage: UnreviewedAccepted

comment:5 by Guilherme Gondim, 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.

by Guilherme Gondim, 13 years ago

Attachment: 16349-patch.diff added

Better one.

comment:6 by Guilherme Gondim, 13 years ago

New patch attached, thank you! :-)

comment:7 by Claude Paroz, 13 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:8 by anonymous, 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.

by Claude Paroz, 13 years ago

Attachment: 16349-2.diff added

Same with DATE_FORMAT/DATETIME_FORMAT also fixed

comment:9 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: newclosed

In [16724]:

Fixed #16349 -- Fixed Brazilian localization formats. Thanks, Claude Paroz, semente and Guiljerme Gondim.

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