changeset 2704:ab37d1c7c38c

jp (base): new date_decoder to specify dates in arguments
author Goffi <goffi@goffi.org>
date Sat, 01 Dec 2018 10:41:37 +0100
parents 3ba53b1cd1e6
children 0bb811aaf11d
files sat_frontends/jp/base.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Sat Dec 01 10:40:19 2018 +0100
+++ b/sat_frontends/jp/base.py	Sat Dec 01 10:41:37 2018 +0100
@@ -35,6 +35,7 @@
 from sat.tools import config
 from sat.tools.common import dynamic_import
 from sat.tools.common import uri
+from sat.tools.common import date_utils
 from sat.core import exceptions
 import sat_frontends.jp
 from sat_frontends.jp.constants import Const as C
@@ -137,6 +138,10 @@
     return arg.decode(locale.getpreferredencoding())
 
 
+def date_decoder(arg):
+    return date_utils.date_parse_ext(arg, default_tz=date_utils.TZ_LOCAL)
+
+
 class Jp(object):
     """
     This class can be use to establish a connection with the