Code

Opened 5 years ago

Closed 5 years ago

#11367 closed (duplicate)

Use settings instead of defaults for forms.DateField and similars

Reported by: hcarvalhoalves 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:

Description

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.

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by hcarvalhoalves

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.