Skip to content

Commit

Permalink
Convert add-on submission time to seconds (nvaccess#17193)
Browse files Browse the repository at this point in the history
Part of nvaccess#16681, fixup of PR 17091

Summary of the issue:
Add-on submissionTime in json metadata files is in milliseconds, but it needs to be converted to seconds to be transformed in a publicationDate

Description of user facing changes
None

Description of development approach
Convert add-on submissionTime to seconds in addonStore/models/addon.py
  • Loading branch information
nvdaes authored Sep 19, 2024
1 parent a0fefe3 commit 39da8bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/addonStore/models/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def isPendingInstall(self) -> bool:
def publicationDate(self) -> str | None:
if self.submissionTime is None:
return None
return datetime.strftime(datetime.fromtimestamp(self.submissionTime), "%x")
# Convert `self.submissionTime` to seconds.
return datetime.strftime(datetime.fromtimestamp(self.submissionTime // 1000), "%x")


class _AddonManifestModel(_AddonGUIModel):
Expand Down

0 comments on commit 39da8bf

Please sign in to comment.