Skip to content

Commit

Permalink
Merge branch 'fix/#14-next-backup-date' into 'main':
Browse files Browse the repository at this point in the history
commit 418bc86ddba17a8e0fd0fca76ebb216dcd403bc1
Author: Lukas Pistrol <[email protected]>
Date:   Tue Nov 28 12:21:03 2023 +0100

    fix next backup date is in the past when failed attempt
  • Loading branch information
lukepistrol committed Nov 28, 2023
1 parent e08ca01 commit 020913d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
16 changes: 16 additions & 0 deletions TimeMachineStatus/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,22 @@
}
}
},
"label_nextbackup_issue" : {
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Letztes automatisches Backup fehlgeschlagen"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Last automatic backup failed"
}
}
}
},
"section_destinations" : {
"extractionState" : "manual",
"localizations" : {
Expand Down
9 changes: 7 additions & 2 deletions TimeMachineStatus/Views/MenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,13 @@ struct MenuView: View {
Text("label_lastbackup_\(latestDate.formatted(.relativeDate))_on_\(latestVolume)")
if let interval = utility.preferences?.autoBackupInterval, utility.preferences?.autoBackup == true {
let nextDate = latestDate.addingTimeInterval(.init(interval))
Text("label_nextbackup_\(nextDate.formatted(.relativeDate))")
.font(.caption)
if nextDate < .now {
Text("label_nextbackup_issue")
.font(.caption)
} else {
Text("label_nextbackup_\(nextDate.formatted(.relativeDate))")
.font(.caption)
}
} else {
Text("label_autobackupdisabled")
.font(.caption)
Expand Down

0 comments on commit 020913d

Please sign in to comment.