[+] Sort alarms on save
This commit is contained in:
@@ -140,6 +140,7 @@ class Alarms: Codable
|
|||||||
/// Save alarms to local storage
|
/// Save alarms to local storage
|
||||||
func localSave()
|
func localSave()
|
||||||
{
|
{
|
||||||
|
list.sort { ($0.hour * 60 + $0.minute) < ($1.hour * 60 + $1.minute) }
|
||||||
localStorage.setValue(JSON.stringify(list)!, forKey: "alarms")
|
localStorage.setValue(JSON.stringify(list)!, forKey: "alarms")
|
||||||
|
|
||||||
// Reload table view
|
// Reload table view
|
||||||
|
|||||||
Reference in New Issue
Block a user