Italian locale SHORT_DATE_FORMAT

24 views
Skip to first unread message

Craig Blaszczyk

unread,
Feb 10, 2012, 9:39:11 AM2/10/12
to djang...@googlegroups.com
Hi all,

I've noticed an inconsistency in the `it` locale formats.py file (django/conf/locale/it/formats.py) both in Django 1.3.1 and trunk.

The file contains:
SHORT_DATE_FORMAT = 'd/M/Y' # 25/12/2009
....
DATE_INPUT_FORMATS = (
    '%d/%m/%Y', '%Y/%m/%d',  # '25/10/2006', '2008/10/25'
    '%d-%m-%Y', '%Y-%m-%d',  # '25-10-2006', '2008-10-25'
    '%d-%m-%y', '%d/%m/%y',  # '25-10-06', '25/10/06'
)

1) The SHORT_DATE_FORMAT  format listed does not match the comment (note the 'M' in the format - this should be 'm' for a numerical month)
2) The listed SHORT_DATE_FORMAT is not one of the accepted DATE_INPUT_FORMATS

Point 1 could easily be a typo, but point 2 is a bit more serious. It means that if you use SHORT_DATE_FORMAT to format the default date in a form, then that default does not pass validation when the form is submitted.

For example, today's date as output by SHORT_DATE_FORMAT is '10/Feb/2012'. If this is used as the default value for a form field, then that form field will fail validation.

Is this desired behaviour? Shall I raise a bug?

--Craig Blaszczyk

Sergiy Kuzmenko

unread,
Feb 10, 2012, 11:35:23 AM2/10/12
to djang...@googlegroups.com
Yes. I'd call it a bug. Should be small "m" in SHORT_DATE_FORMAT.


--Craig Blaszczyk

--
You received this message because you are subscribed to the Google Groups "Django internationalization and localization" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-i18n/-/0Jl1cuVGgoAJ.
To post to this group, send email to djang...@googlegroups.com.
To unsubscribe from this group, send email to django-i18n...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-i18n?hl=en.

Craig Blaszczyk

unread,
Feb 10, 2012, 12:45:50 PM2/10/12
to djang...@googlegroups.com
That's what I thought. I've opened  https://code.djangoproject.com/ticket/17670

Sergiy Kuzmenko

unread,
Feb 10, 2012, 3:02:51 PM2/10/12
to djang...@googlegroups.com
FYI. In Italian Wikipedia short dates are formatted as "d M Y" (e.g., 21 gen 2012).


On Fri, Feb 10, 2012 at 12:45 PM, Craig Blaszczyk <maste...@gmail.com> wrote:
That's what I thought. I've opened  https://code.djangoproject.com/ticket/17670

--
You received this message because you are subscribed to the Google Groups "Django internationalization and localization" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-i18n/-/Evao--0W4sMJ.
Reply all
Reply to author
Forward
0 new messages