Opened 9 years ago

Closed 9 years ago

#4542 closed (fixed)

generic localflavor date field

Reported by: nick.lane.au@… Owned by: nobody
Component: contrib.localflavor Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've added a patch to add an AUDateField and AUDateTimeField to the Australian localflavor contrib. They're just extensions of regular DateField and DateTimeField's that use Australian "dd/mm/yy" (etc) date formats by default.

Another possibility would be to just define AU_DATE_INPUT_FORMATS and AU_DATETIME_INPUT_FORMATS tuples and then pass them in to regular DateField's as the input_format argument.

Attachments (3)

au_dates.diff (2.6 KB) - added by nick.lane.au@… 9 years ago.
Australian date fields
generic-localflavor.diff (8.1 KB) - added by nick.lane.au@… 9 years ago.
Generic localflavor with date fields
4542.diff (7.4 KB) - added by nick.lane.au@… 9 years ago.
Patch against r5625

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by nick.lane.au@…

Attachment: au_dates.diff added

Australian date fields

comment:1 Changed 9 years ago by nick.lane.au@…

Component: Uncategorizeddjango.contrib.localflavor
Has patch: set
Owner: changed from Jacob to Adrian Holovaty

comment:2 Changed 9 years ago by Chris Beaven

Triage Stage: UnreviewedDesign decision needed

I'll move to design decision until the way to handle this is agreed on. Perhaps you could take it to the developer's group?

comment:3 Changed 9 years ago by Malcolm Tredinnick

Triage Stage: Design decision neededAccepted

We should probably give these better names, since they aren't specific to Australia. The North American format is by far the minority case.

The settings aren't a good idea, because it will conflict with far too many places where there are existing date format strings and we'll be fielding actual and perceived bug reports until the cows come home. Plus, again, they aren't .au specific.

We might make a "generic" directory (or similar name) under localflavor/ for this sort of thing. Then the classes can just be called DateField and DateTimeField (because the import location namespaces them sufficiently).

Patch is missing tests, too.

comment:4 Changed 9 years ago by Malcolm Tredinnick

Needs tests: set
Patch needs improvement: set

Changed 9 years ago by nick.lane.au@…

Attachment: generic-localflavor.diff added

Generic localflavor with date fields

comment:5 Changed 9 years ago by nick.lane.au@…

Last patch is against 0.96 (before localflavor tests were added) because I can't access svn.

Changed 9 years ago by nick.lane.au@…

Attachment: 4542.diff added

Patch against r5625

comment:6 Changed 9 years ago by Simon G. <dev@…>

Needs tests: unset
Patch needs improvement: unset
Summary: AU localflavor date fieldgeneric localflavor date field
Triage Stage: AcceptedReady for checkin

4542 looks good, and appears to answer all MT's quibbles above.

comment:7 Changed 9 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [6208]) Fixed #4542: added a generic localflavor DateField. Thanks, Nick Lane.

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