Skip to content

Commit

Permalink
Update models.py
Browse files Browse the repository at this point in the history
- fix missing minutes
- avoid useless formatting for hours
  • Loading branch information
eric-intuitem committed Dec 10, 2024
1 parent f5b8ffa commit 77d0ab6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1587,10 +1587,9 @@ def format_seconds(seconds: int) -> str:

parts = []
if hours > 0:
parts.append(f"{hours:02d}h")
if minutes > 0:
parts.append(f"{minutes:02d}m")

parts.append(f"{hours}h")
if minutes > 0:
parts.append(f"{minutes:02d}m")
if secs > 0 or (
not parts
): # Always show seconds if no other parts, or if > 0
Expand Down

0 comments on commit 77d0ab6

Please sign in to comment.