change a bunch of shit to get importing / adding new vote have the right weekday

This commit is contained in:
Trey t
2022-04-05 22:33:12 -05:00
parent dec8f2d84d
commit 6fa4e2db26
17 changed files with 141 additions and 190 deletions

View File

@@ -58,15 +58,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
if let action = LocalNotification.ActionType(rawValue: response.actionIdentifier) {
var date: Date
switch savedOnboardingData.inputDay {
case .Today:
date = Date()
case .Previous:
date = Calendar.current.date(byAdding: .day, value: -1, to: Date())!
}
let date = ShowBasedOnVoteLogics.getCurrentVotingDate(onboardingData: savedOnboardingData)
switch action {
case .horrible:
PersistenceController.shared.add(mood: .horrible, forDate: date, entryType: .notification)