mirror of
https://github.com/wahyd4/Yep.git
synced 2026-08-25 20:56:45 +10:00
time format
This commit is contained in:
@@ -94,10 +94,10 @@ extension DoNotDisturbPeriodViewController: UIPickerViewDataSource, UIPickerView
|
||||
func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String! {
|
||||
|
||||
if component == 0 {
|
||||
return "\(row % 24)"
|
||||
return String(format: "%02d", row % 24)
|
||||
|
||||
} else if component == 1 {
|
||||
return "\(row % 60)"
|
||||
return String(format: "%02d", row % 60)
|
||||
}
|
||||
|
||||
return ""
|
||||
|
||||
@@ -18,10 +18,10 @@ struct DoNotDisturbPeriod {
|
||||
var toMinute: Int = 30
|
||||
|
||||
var fromString: String {
|
||||
return "\(fromHour):\(fromMinute)"
|
||||
return String(format: "%02d:%02d", fromHour, fromMinute)
|
||||
}
|
||||
var toString: String {
|
||||
return "\(toHour):\(toMinute)"
|
||||
return String(format: "%02d:%02d", toHour, toMinute)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user