From c4428e479f47fc3a6df09eb3c340c196b47243ae Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 4 Sep 2019 10:29:05 +0100 Subject: Force removal of ":" from user_time.py API-provided ISO8601 --- modules/user_time.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/user_time.py b/modules/user_time.py index 47ba1708..8fe3faa2 100644 --- a/modules/user_time.py +++ b/modules/user_time.py @@ -29,6 +29,12 @@ class Module(ModuleManager.BaseModule): page = utils.http.request(API % location["timezone"], json=True) if page and page.data and not page.data.get("error", None): + iso8601 = page.data["datetime"] + iso8601_dt, sep, timezone = iso8601.partition("+") + if sep: + iso8601 = "%s+%s" % ( + iso8601_dt, timezone.replace(":", "", 1)) + dt = utils.iso8601_parse(page.data["datetime"], microseconds=True) human = utils.datetime_human(dt) -- cgit v1.3.1-10-gc9f91