[PR] Merge back to main branch

[PR] Merge back to main branch
This commit is contained in:
Hykilpikonna
2021-01-23 23:26:48 -05:00
committed by GitHub
4 changed files with 5 additions and 4 deletions
+1
View File
@@ -87,6 +87,7 @@ class LoginVC: UIViewController
let errors = ["409 - [\"A0111\"]": "Account already exists, please login instead.",
"401 -": "Incorrect username/password",
"404 -": "Username does not exist in the database",
"406 - [\"A0101\"]": "Username invalid."
]
// Send register request
+2 -2
View File
@@ -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: ", ")
+1 -1
View File
@@ -7,7 +7,7 @@
import Foundation
/// Base URL of the HTTP server
let baseUrl = "http://localhost:8080" // TODO: Production settings
let baseUrl = "https://alarm-clock-api.hydev.org"
/// Json class
class JSON
+1 -1
View File
@@ -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[1], lastActivate: Date().added(.minute, -1))) }.localSave()
Alarms.fromLocal().apply { $0.list.append(Alarm(hour: h, minute: m, text: "Test alarm - \(h * m)", wakeMethod: wvms[1], repeats: [true, true, true, true, true, true, true], oneTime: true, lastActivate: Date().added(.minute, -1))) }.localSave()
}
@IBAction func deleteAlarm(_ sender: Any)