Force removal of ":" from user_time.py API-provided ISO8601
This commit is contained in:
parent
397cfa8e7e
commit
c4428e479f
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue