Leading zeros for day, hour and minute counter

This commit is contained in:
Raimund Wege committed 2016-06-27 08:58:45 +02:00
1 parent 5b424e0bef
commit 81827aaf9b
1 file changed
+3 -3
@@ -144,9 +144,9 @@ class RegattaViewController : UIViewController, UIActionSheetDelegate, UINavigat
let days = floor(delta / secondsInDay)
let hours = floor((delta - days * secondsInDay) / secondsInHour)
let minutes = floor((delta - days * secondsInDay - hours * secondsInHour) / 60.0)
self.countdownDaysLabel.text = String(format: "%.0f", arguments: [days])
self.countdownHoursLabel.text = String(format: "%.0f", arguments: [hours])
self.countdownMinutesLabel.text = String(format: "%.0f", arguments: [minutes])
self.countdownDaysLabel.text = String(format: "%02d", Int(days))
self.countdownHoursLabel.text = String(format: "%02d", Int(hours))
self.countdownMinutesLabel.text = String(format: "%02d", Int(minutes))
self.countdownView.hidden = false
self.countdownViewHeight.constant = 60
timer?.invalidate()