summaryrefslogtreecommitdiff
path: root/django/newforms
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2008-07-18 03:47:27 +0000
committerAdrian Holovaty <adrian@holovaty.com>2008-07-18 03:47:27 +0000
commitdf2b19cc17666fe36a8153c3de45b20ffe3334ab (patch)
treed491426d07dba69bfddbfb4aaa2f632331b30ef9 /django/newforms
parentf6fafc02c8ba60b950bbe6be3b3ba729038dbb0a (diff)
Fixed #1443 -- Django's various bits now support dates before 1900. Thanks to SmileyChris, Chris Green, Fredrik Lundh and others for patches and design help
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7946 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms')
-rw-r--r--django/newforms/widgets.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/newforms/widgets.py b/django/newforms/widgets.py
index ebbf2ab727..dc36530b93 100644
--- a/django/newforms/widgets.py
+++ b/django/newforms/widgets.py
@@ -15,6 +15,7 @@ from django.utils.html import escape, conditional_escape
from django.utils.translation import ugettext
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
+from django.utils import datetime_safe
from util import flatatt
__all__ = (
@@ -170,6 +171,7 @@ class DateTimeInput(Input):
if value is None:
value = ''
elif hasattr(value, 'strftime'):
+ value = datetime_safe.new_datetime(value)
value = value.strftime(self.format)
return super(DateTimeInput, self).render(name, value, attrs)