Force removal of ":" from user_time.py API-provided ISO8601

This commit is contained in:
jesopo 2019-09-04 10:29:05 +01:00
parent 397cfa8e7e
commit c4428e479f

View file

@ -29,6 +29,12 @@ class Module(ModuleManager.BaseModule):
page = utils.http.request(API % location["timezone"], json=True) page = utils.http.request(API % location["timezone"], json=True)
if page and page.data and not page.data.get("error", None): 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"], dt = utils.iso8601_parse(page.data["datetime"],
microseconds=True) microseconds=True)
human = utils.datetime_human(dt) human = utils.datetime_human(dt)