Permalink
Browse files

Initialize timezone according to global settings.

  • Loading branch information...
1 parent 8c3977e commit 082e25629f057c9de5a03f872a6fb5c6e45255d3 @paluh committed Nov 20, 2010
Showing with 4 additions and 3 deletions.
  1. +1 −1 django_tz/__init__.py
  2. +3 −2 django_tz/forms.py
View
@@ -1,4 +1,4 @@
-VERSION = (0, 1, 0, "dev", 1)
+VERSION = (0, 5, 0, "dev", 1)
View
@@ -79,7 +79,8 @@ def decompress(self, value):
value = pytz.timezone(settings.TIME_ZONE).localize(value)
tz = self.get_timezone(value)
value = adjust_datetime_to_timezone(value, value.tzinfo, tz)
- return super(LocalizedDateTimeWidget, self).decompress(value)
+ return super(LocalizedDateTimeWidget, self).decompress(value)
+ return [None, self.get_timezone(value)]
class LocalizedDateTimeField(TimeZoneDateTimeField):
"""
@@ -100,7 +101,7 @@ def decompress(self, value):
splited = super(SplitLocalizedDateTimeWidget, self).decompress(value)
if splited[0]:
return [splited[0].date(), splited[0].time().replace(microsecond=0), splited[1]]
- return [None, None, None]
+ return [None, None, splited[1]]
class SplitLocalizedDateTimeField(MultiValueField):
widget = SplitLocalizedDateTimeWidget

0 comments on commit 082e256

Please sign in to comment.