Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initialize timezone according to global settings.

  • Loading branch information...
commit 082e25629f057c9de5a03f872a6fb5c6e45255d3 1 parent 8c3977e
@paluh authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  django_tz/__init__.py
  2. +3 −2 django_tz/forms.py
View
2  django_tz/__init__.py
@@ -1,4 +1,4 @@
-VERSION = (0, 1, 0, "dev", 1)
+VERSION = (0, 5, 0, "dev", 1)
View
5 django_tz/forms.py
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.