Opened 14 years ago
Closed 5 years ago
#15982 closed Bug (fixed)
Lack DateTime formats in some languages
Reported by: | Pablo Martín | Owned by: | Claude Paroz |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Lack DateTime formats in some languages.
For example in english:
DATETIME_INPUT_FORMATS = ( '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59' '%Y-%m-%d %H:%M', # '2006-10-25 14:30' '%Y-%m-%d', # '2006-10-25' '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59' '%m/%d/%Y %H:%M', # '10/25/2006 14:30' '%m/%d/%Y', # '10/25/2006' '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59' '%m/%d/%y %H:%M', # '10/25/06 14:30' '%m/%d/%y', # '10/25/06' )
But in spanish, I think that it lacks this format '%d/%m/%y'
:
DATETIME_INPUT_FORMATS = ( '%d/%m/%Y %H:%M:%S', '%d/%m/%Y %H:%M', '%d/%m/%y %H:%M:%S', '%d/%m/%y %H:%M', )
Attachments (1)
Change History (8)
comment:1 by , 14 years ago
Component: | Uncategorized → Internationalization |
---|---|
Type: | Uncategorized → Bug |
by , 14 years ago
Attachment: | patchr16182_locale.diff added |
---|
comment:2 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
It is possible that the formats could be grouped. But this is not the scope of the ticket. It's a little change to fix a bug.
Also it would also be difficult to overwrite
comment:4 by , 13 years ago
Needs tests: | set |
---|---|
UI/UX: | unset |
I assume that the English locale approach of allowing date formats to datetime fields is the right one. Then, I think it makes more sense what aaugustin says, of getting rid of the date formats in the datetime settings, and change the code to allow this.
My only concern is that if there is a side case, where order can matter. Formats are checked in order, and testing first the datetime ones, and then the date ones, won't let a locale to specify the exact order.
comment:6 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Indeed, there is an inconsistency here.
pmartin, are
ca
andes_*
the only languages where datetime input formats do not include the date input formats?More generally, wouldn't it be a good idea to consider any valid date input format and a valid datetime_input_format, and remove a lot of copy-paste from the
formats.py
files?