Code

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#10353 closed New feature (wontfix)

prompt the correct date/time format in the error message

Reported by: dryice Owned by: nobody
Component: Forms Version: 1.0
Severity: Normal Keywords: date time datetime
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

prompt the correct date/time format in the error message in case the user want to manually input the date/time fields.

Attachments (1)

datetime_error_message.diff (1.5 KB) - added by dryice 5 years ago.

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by dryice

comment:1 Changed 5 years ago by dryice

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

The strings are the same as in db/models/fields/init.py

comment:2 Changed 5 years ago by ericholscher

  • Triage Stage changed from Unreviewed to Accepted

This seems like a logical change. Giving people more information about errors is generally better.

I don't know about the "programmery" strings like: HH:MM[:ss[.uuuuuu]]. I dunno if people need to know about microseconds. Perhaps just using HH:MM there?

comment:3 Changed 5 years ago by dryice

The strings are the same as in source:django/trunk/django/db/models/fields/__init__.py to be consistent. But yes, I agree that end user don't need to know about microseconds most of the time.

comment:4 Changed 3 years ago by SmileyChris

  • Resolution set to wontfix
  • Severity set to Normal
  • Status changed from new to closed
  • Type set to New feature

I'm not sure this is a good idea. It relies on the assumption that the field needs to be entered in a specific format. What if you're using a SelectDateWidget, or alternative input_formats on the field?

comment:5 Changed 3 years ago by dryice

"the assumption that the field needs to be entered in a specific format" is not coded in this patch, it's already in the code for DateField/TimeField/DateTimeField

However I saw another reason why the patch should not be applied: Because the format check in the existing code has been i18n-ed, and checking all the formats.py in django/conf/locale/xx, there's no a universal format. So specifying the YYYY-MM-DD format in the error message may confuse some users don't use this format.

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.