Skip to content

Commit

Permalink
Fix 24 hour limit when displaying estimated time (#20)
Browse files Browse the repository at this point in the history
* Remove 24 hour cap when displaying estimated time

* Swap out gmdate

---------

Co-authored-by: nickbeen <nickbeen@users.noreply.github.com>
  • Loading branch information
nickbeen and nickbeen authored Jun 20, 2024
1 parent abcea2f commit 11a51b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ private function display(): ProgressBar
/** Remove estimated time from display when done */
if ($this->percentage < 100) {
echo sprintf(
' (%s)',
(
$this->estimatedTime < 86400 ? gmdate('H:i:s', $this->estimatedTime) : '>23:59:59'
)
' (%02d:%02d:%02d)',
floor($this->estimatedTime / 3600),
floor($this->estimatedTime / 60) % 60,
floor($this->estimatedTime) % 60
);
}

Expand Down

0 comments on commit 11a51b5

Please sign in to comment.