diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aa87fe536..489694236 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/dcicutils/misc_utils.py b/dcicutils/misc_utils.py index 5de86755e..2df638862 100644 --- a/dcicutils/misc_utils.py +++ b/dcicutils/misc_utils.py @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 3c928af98..7960efa50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "MIT"