Skip to content

Commit

Permalink
Display hours only if non 0
Browse files Browse the repository at this point in the history
  • Loading branch information
karpev98 committed May 25, 2023
1 parent 6116ee1 commit 1141b6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/utility/time_keeper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class TimeKeeper with ChangeNotifier {
final String hourLeft = h.toString().length < 2 ? "0$h" : h.toString();
final String minuteLeft = m.toString().length < 2 ? "0$m" : m.toString();
final String secondsLeft = s.toString().length < 2 ? "0$s" : s.toString();
if (hourLeft == "00") {
return "$minuteLeft:$secondsLeft";
}

return "$hourLeft:$minuteLeft:$secondsLeft";
}
Expand Down

0 comments on commit 1141b6a

Please sign in to comment.