Opened 9 years ago

Closed 9 years ago

#11367 closed (duplicate)

Use settings instead of defaults for forms.DateField and similars

Reported by: Henrique C. Alves Owned by: nobody
Component: Forms Version: master
Severity: Keywords: forms newforms settings date time
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


There's already two settings used by the template date and time filters (DATE_FORMAT and TIME_FORMAT), used for formatting in similar way as PHP's date(). Form fields like Date and Time, OTH, use strftime() formatting strings, and have hardcoded defaults.

It's common to inherit from those fields just for changing default formats and avoid boilerplate code (e.g, having to set date_format= in every form).

Those fields could, instead, make use of the DATE_FORMAT and TIME_FORMAT settings as defaults, if those are present.

Change History (1)

comment:1 Changed 9 years ago by Henrique C. Alves

Resolution: duplicate
Status: newclosed

#5526 is an even better approach to solve this on a locale-aware way. Might consider discussing this for 1.2?

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