mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
convert the createAt value to local timezone
This commit is contained in:
parent
2d73f6a6aa
commit
c1cba8640f
3 changed files with 3 additions and 3 deletions
|
|
@ -606,7 +606,7 @@ def convert_v4_version_to_v3(version):
|
||||||
output_data[dst_key] = version[src_key]
|
output_data[dst_key] = version[src_key]
|
||||||
|
|
||||||
if "createdAt" in version:
|
if "createdAt" in version:
|
||||||
created_at = arrow.get(version["createdAt"])
|
created_at = arrow.get(version["createdAt"]).to("local")
|
||||||
output_data["time"] = created_at.strftime("%Y%m%dT%H%M%SZ")
|
output_data["time"] = created_at.strftime("%Y%m%dT%H%M%SZ")
|
||||||
|
|
||||||
output["data"] = output_data
|
output["data"] = output_data
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ def version_item_from_entity(version):
|
||||||
# NOTE There is also 'updatedAt', should be used that instead?
|
# NOTE There is also 'updatedAt', should be used that instead?
|
||||||
# TODO skip conversion - converting to '%Y%m%dT%H%M%SZ' is because
|
# TODO skip conversion - converting to '%Y%m%dT%H%M%SZ' is because
|
||||||
# 'PrettyTimeDelegate' expects it
|
# 'PrettyTimeDelegate' expects it
|
||||||
created_at = arrow.get(version["createdAt"])
|
created_at = arrow.get(version["createdAt"]).to("local")
|
||||||
published_time = created_at.strftime("%Y%m%dT%H%M%SZ")
|
published_time = created_at.strftime("%Y%m%dT%H%M%SZ")
|
||||||
author = version["author"]
|
author = version["author"]
|
||||||
version_num = version["version"]
|
version_num = version["version"]
|
||||||
|
|
|
||||||
|
|
@ -606,7 +606,7 @@ class PublishWorkfilesModel:
|
||||||
print("Failed to format workfile path: {}".format(exc))
|
print("Failed to format workfile path: {}".format(exc))
|
||||||
|
|
||||||
dirpath, filename = os.path.split(workfile_path)
|
dirpath, filename = os.path.split(workfile_path)
|
||||||
created_at = arrow.get(repre_entity["createdAt"])
|
created_at = arrow.get(repre_entity["createdAt"].to("local"))
|
||||||
return FileItem(
|
return FileItem(
|
||||||
dirpath,
|
dirpath,
|
||||||
filename,
|
filename,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue