From 7409e024fa2e74cb07e3c7a98240a4b8a91caa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 6 Apr 2017 10:45:38 +0200 Subject: [PATCH] Use custom hour with microsecond format Appending microsecond to the locale time format does not always work when the locale use AM/PM notation. issue6398 review30211002 --- tryton/gui/window/form.py | 6 +++--- tryton/gui/window/revision.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index b8fc56ace8..6bb3db0a61 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -254,7 +254,7 @@ class Form(SignalEvent, TabContent): except RPCException: return date_format = self.screen.context.get('date_format', '%x') - datetime_format = date_format + ' %X.%f' + datetime_format = date_format + ' %H:%M:%S.%f' message_str = '' for line in res: for (key, val) in fields: @@ -280,7 +280,7 @@ class Form(SignalEvent, TabContent): return revision = self.screen.context.get('_datetime') format_ = self.screen.context.get('date_format', '%x') - format_ += ' %X.%f' + format_ += ' %H:%M:%S.%f' revision = Revision(revisions, revision, format_).run() # Prevent too old revision in form view if (self.screen.current_view.view_type == 'form' @@ -304,7 +304,7 @@ class Form(SignalEvent, TabContent): revision = self.screen.context.get('_datetime') if revision: format_ = self.screen.context.get('date_format', '%x') - format_ += ' %X.%f' + format_ += ' %H:%M:%S.%f' revision = datetime_strftime(revision, format_) self.title.set_label('%s @ %s' % (self.name, revision)) else: diff --git a/tryton/gui/window/revision.py b/tryton/gui/window/revision.py index 1c37d082f5..3a4d8a1a36 100644 --- a/tryton/gui/window/revision.py +++ b/tryton/gui/window/revision.py @@ -14,7 +14,7 @@ _ = gettext.gettext class Revision(object): 'Ask revision' - def __init__(self, revisions, revision=None, format_='%x %X.%f'): + def __init__(self, revisions, revision=None, format_='%x %H:%M:%S.%f'): self.parent = get_toplevel_window() self.win = gtk.Dialog(_('Revision'), self.parent, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,