Opened 9 years ago

Closed 7 years ago

#5526 closed (fixed)

Localized Date/DateTime fields proposal

Reported by: Jan Rademaker Owned by: Marc Garcia
Component: contrib.localflavor Version: master
Severity: Keywords: i18n-fixed
Cc: Triage Stage: Fixed on a branch
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

This is an attempt at providing Date/DateTime fields for locales other than
English. The patch provides a DateField, DateTimeField and
DateTimeInput widget that accept Dutch input.

It should be relatively easy to add additional locales (at least, that was the setup) .

Short example:

>>> from django.contrib.localflavor.nl.forms import DateField
>>> f = DateField()
>>> f.clean('25 augustus 2003')
datetime.date(2003, 8, 25)

>>> from django.contrib.localflavor.nl.widgets import DateTimeInput
>>> d = DateTimeInput(date_output_format='%d %B %Y')
>>> d.render('foo', datetime.now())
u'<input type="text" name="foo" value="17 september 2007" />'

Attachments (1)

localflavor_datetimefields.patch (12.6 KB) - added by Jan Rademaker 9 years ago.
Reattached the patch

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by Jan Rademaker

Reattached the patch

comment:1 Changed 9 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedDesign decision needed

Interesting idea janr - can you float this on django-developers?

comment:3 Changed 8 years ago by Marc Garcia

Keywords: i18n-rf added

comment:4 Changed 8 years ago by anonymous

milestone: post-1.0

comment:5 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 Changed 7 years ago by Marc Garcia

Keywords: i18n-fixed added; i18n-rf removed
Owner: changed from nobody to Marc Garcia

Fixed in branches/soc2009/i18n-improvements.

comment:7 Changed 7 years ago by Marc Garcia

Triage Stage: Design decision neededFixed on a branch

comment:8 Changed 7 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [11964]) Fixed #7980 - Improved i18n framework to support locale aware formatting (dates and numbers) and form processing.

Thanks to Marc Garcia for working on this during his Google Summer of Code 2009!

Additionally fixes #1061, #2203, #3940, #5526, #6449, #6231, #6693, #6783, #9366 and #10891.

Note: See TracTickets for help on using tickets.
Back to Top