changeset c742c29bf042 in tryton:4.8
details: https://hg.tryton.org/tryton?cmd=changeset;node=c742c29bf042
description:
        Show revision datetime in local timezone

        issue8365
        review271441002
        (grafted from ed4206bb000eb5ff0e5c59d6d1bdb0e3d5f84c66)
diffstat:

 tryton/gui/window/revision.py |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 0ce079768bd9 -r c742c29bf042 tryton/gui/window/revision.py
--- a/tryton/gui/window/revision.py     Mon Jun 10 18:31:46 2019 +0200
+++ b/tryton/gui/window/revision.py     Mon May 27 23:18:37 2019 +0200
@@ -4,7 +4,8 @@
 import gettext
 
 from tryton.config import TRYTON_ICON
-from tryton.common import get_toplevel_window
+from tryton.common import (get_toplevel_window,
+    timezoned_date, untimezoned_date)
 from tryton.common.datetime_strftime import datetime_strftime
 from tryton.common.datetime_ import date_parse
 
@@ -50,7 +51,8 @@
             active = 0
         list_store.append(('', ''))
         for i, (rev, id_, name) in enumerate(revisions, 1):
-            list_store.append((datetime_strftime(rev, self._format), name))
+            list_store.append(
+                (datetime_strftime(timezoned_date(rev), self._format), name))
             if rev == revision:
                 active = i
         combobox.set_active(active)
@@ -85,7 +87,7 @@
         value = None
         if text:
             try:
-                value = date_parse(text, self._format)
+                value = untimezoned_date(date_parse(text, self._format))
             except ValueError:
                 pass
         self._value = value

Reply via email to