Skip to content

Commit

Permalink
minor fix to misc_utils.format_duration
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Sep 9, 2024
1 parent cb49834 commit 6334238
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Change Log
* Minor changes to view_portal_object utility script.
* Minor changes to validators hooks in structured_data.
* Added portal_utils.Portal.get_version method.
* Minor fix in misc_utils.format_duration.


8.14.3
Expand Down
2 changes: 1 addition & 1 deletion dcicutils/misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2802,7 +2802,7 @@ def format_duration(seconds: Union[int, float]) -> str:
durations = [("year", 31536000), ("day", 86400), ("hour", 3600), ("minute", 60), ("second", 1)]
parts = []
for name, duration in durations:
if seconds >= duration:
if (seconds == 0) or (seconds >= duration):
count = seconds // duration
seconds %= duration
if count != 1:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.14.3.1b4" # TODO: To become 8.14.4
version = "8.14.3.1b5" # TODO: To become 8.14.4
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 6334238

Please sign in to comment.