Opened 6 years ago

Closed 6 years ago

#7970 closed (invalid)

DateField incorrect default value in newforms admin

Reported by: dcramer Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The DateField is starting with an incorrect value when using in the admin.

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by mtredinnick

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

When you provide a callable for the default, the result of calling that function/method/object is used as the default value. It's up to you to provide a callable that returns a value of the right type. In this case, would be an appropriate callable for a DateField. Using returns a date and time, which isn't appropriate for that type of field.

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.