Opened 17 years ago

Closed 15 years ago

#5526 closed (fixed)

Localized Date/DateTime fields proposal

Reported by: Jan Rademaker Owned by: Marc Garcia
Component: contrib.localflavor Version: dev
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: no UI/UX: no

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 17 years ago.
Reattached the patch

Download all attachments as: .zip

Change History (9)

by Jan Rademaker, 17 years ago

Reattached the patch

comment:1 by Simon G. <dev@…>, 17 years ago

Triage Stage: UnreviewedDesign decision needed

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

comment:3 by Marc Garcia, 16 years ago

Keywords: i18n-rf added

comment:4 by anonymous, 16 years ago

milestone: post-1.0

comment:5 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 by Marc Garcia, 15 years ago

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

Fixed in branches/soc2009/i18n-improvements.

comment:7 by Marc Garcia, 15 years ago

Triage Stage: Design decision neededFixed on a branch

comment:8 by Jannis Leidel, 15 years ago

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