[O] Encapsulate Alarm.textLabel
This commit is contained in:
@@ -497,8 +497,7 @@ extension FamilyAddAlarmVC: UITableViewDelegate, UITableViewDataSource
|
||||
func tableView(_ view: UITableView, cellForRowAt i: IndexPath) -> UITableViewCell
|
||||
{
|
||||
let cell = view.dequeueReusableCell(withIdentifier: "family-alarm-cell", for: i)
|
||||
let alarm = Alarms.fromLocal().list[i.row]
|
||||
cell.textLabel?.text = String(format: "%i:%02i", alarm.hour, alarm.minute)
|
||||
cell.textLabel?.text = Alarms.fromLocal().list[i.row].timeText
|
||||
return cell
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,9 @@ class Alarm: Codable, Equatable
|
||||
/// Does it automatically disable after activating once
|
||||
var oneTime: Bool { repeats.allSatisfy { !$0 } }
|
||||
|
||||
/// Get time in h:mm format
|
||||
var timeText: String { String(format: "%i:%02i", hour, minute) }
|
||||
|
||||
/// When should the alarm activate next since lastActivate?
|
||||
var nextActivate: Date?
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user