[F] Fix testing alarm
This commit is contained in:
@@ -73,13 +73,13 @@ class AlarmTableCell: UITableViewCell
|
||||
time.text = alarm.minute < 10 ? "\(hour):0\(alarm.minute)" : "\(hour):\(alarm.minute)"
|
||||
|
||||
// displays the specific days alarm is activated
|
||||
let daysDict = [0: "Mon", 1: "Tues", 2: "Wed", 3: "Thurs", 4: "Fri", 5: "Sat", 6: "Sun"]
|
||||
let daysDict = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]
|
||||
var daysActive : [String] = []
|
||||
if alarm.oneTime {repeatText.text = "No Repeat"}
|
||||
else {
|
||||
for (index, element) in alarm.repeats.enumerated() {
|
||||
if element {
|
||||
daysActive.append(daysDict[index] ?? "")
|
||||
daysActive.append(daysDict[index])
|
||||
}
|
||||
}
|
||||
repeatText.text = daysActive.joined(separator: ", ")
|
||||
|
||||
@@ -58,7 +58,7 @@ class TestingViewController: UIViewController
|
||||
@IBAction func addAlarm(_ sender: Any)
|
||||
{
|
||||
let (h, m, _) = Date().getHMS()
|
||||
Alarms.fromLocal().apply { $0.list.append(Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[0], lastActivate: Date().added(.minute, -1))) }.localSave()
|
||||
Alarms.fromLocal().apply { $0.list.append(Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[0], repeats: [true, true, true, true, true, true, true], oneTime: true, lastActivate: Date().added(.minute, -1))) }.localSave()
|
||||
}
|
||||
|
||||
@IBAction func deleteAlarm(_ sender: Any)
|
||||
|
||||
Reference in New Issue
Block a user