Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.

For more information on this project, see this thread:
cf0423bbb8



git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Aymeric Augustin 2011-11-18 13:01:06 +00:00
parent 01f70349c9
commit 9b1cb755a2
58 changed files with 2720 additions and 284 deletions

View file

@ -10,7 +10,7 @@ from itertools import chain
from urlparse import urljoin
from django.conf import settings
from django.forms.util import flatatt
from django.forms.util import flatatt, to_current_timezone
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, conditional_escape
from django.utils.translation import ugettext, ugettext_lazy
@ -847,6 +847,7 @@ class SplitDateTimeWidget(MultiWidget):
def decompress(self, value):
if value:
value = to_current_timezone(value)
return [value.date(), value.time().replace(microsecond=0)]
return [None, None]