Opened 4 years ago

Closed 3 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@…> 4 years ago.
16349-patch.diff (754 bytes) - added by semente 4 years ago.
Better one.
16349-2.diff (1.2 KB) - added by claudep 3 years ago.
Same with DATE_FORMAT/DATETIME_FORMAT also fixed

Download all attachments as: .zip

Change History (12)

Changed 4 years ago by Guiljerme Gondim <semente+django@…>

comment:1 Changed 4 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 Changed 4 years ago by semente

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 Changed 4 years ago by aaugustin

  • 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 Changed 4 years ago by aaugustin

  • Easy pickings set
  • Triage Stage changed from Unreviewed to Accepted

comment:5 Changed 4 years ago by semente

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.

Changed 4 years ago by semente

Better one.

comment:6 Changed 4 years ago by semente

New patch attached, thank you! :-)

comment:7 Changed 3 years ago by claudep

  • Patch needs improvement unset
  • Triage Stage changed from Accepted to Ready for checkin

comment:8 Changed 3 years ago by anonymous

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.

Changed 3 years ago by claudep

Same with DATE_FORMAT/DATETIME_FORMAT also fixed

comment:9 Changed 3 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

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