@@ -103,22 +103,22 @@ struct NotificationHelper {
103103 } else if contact. preferenceIsWeekly ( ) || contact. preferenceIsMonthly ( ) {
104104 components. hour = contact. notification_preference_hour
105105 components. minute = contact. notification_preference_minute
106- components. weekday = contact. notification_preference_weekday + 1
106+ components. weekday = contact. notification_preference_weekday+ 1
107107 if contact. notification_preference_week_of_month != 0 {
108- components. weekOfMonth = contact. notification_preference_week_of_month + 1
108+ components. weekOfMonth = contact. notification_preference_week_of_month+ 1
109109 }
110110 } else if contact. preferenceIsQuarterly ( ) {
111- print ( " Quarterly is handled separately by UNTimeIntervalNotificationTrigger " )
111+ print ( " Quarterly is handled separately by UNTimeIntervalNotificationTrigger. Fallthrough. " )
112112 } else if contact. preferenceIsAnnually ( ) || contact. preferenceIsCustom ( ) {
113- components. hour = contact. notification_preference_hour
114113 components. minute = contact. notification_preference_minute
114+ components. hour = contact. notification_preference_hour
115+ components. day = contact. notification_preference_custom_day
116+ components. month = contact. notification_preference_custom_month
115117 if contact. preferenceIsAnnually ( ) {
116- components. month = contact . notification_preference_custom_month + 1
118+ components. year = nil
117119 } else if contact. preferenceIsCustom ( ) {
118- components. month = contact. notification_preference_custom_month
120+ components. year = contact. notification_preference_custom_year
119121 }
120- components. day = contact. notification_preference_custom_day
121- components. year = contact. notification_preference_custom_year
122122 }
123123
124124 var soonestUpcomingNotificationDateString = " "
@@ -163,12 +163,12 @@ struct NotificationHelper {
163163 dateComponents. weekOfMonth = contact. notification_preference_week_of_month
164164 } else if contact. preferenceIsAnnually ( ) || contact. preferenceIsCustom ( ) {
165165 if contact. preferenceIsAnnually ( ) {
166- dateComponents. month = contact . notification_preference_custom_month + 1
166+ dateComponents. year = nil
167167 } else if contact. preferenceIsCustom ( ) {
168- dateComponents. month = contact. notification_preference_custom_month
168+ dateComponents. year = contact. notification_preference_custom_year
169169 }
170+ dateComponents. month = contact. notification_preference_custom_month
170171 dateComponents. day = contact. notification_preference_custom_day
171- dateComponents. year = contact. notification_preference_custom_year
172172 dateComponents. hour = contact. notification_preference_hour
173173 dateComponents. minute = contact. notification_preference_minute
174174 }
@@ -399,20 +399,16 @@ struct NotificationHelper {
399399 return formattedDate
400400 }
401401
402- // print("returning Unknown")
403402 return " Unknown "
404403 }
405404
406405 static func setYearPreference( for contact: SelectedContact ) {
407406 var contactDateComponents = NotificationHelper . getNotificationDateComponents ( for: contact)
408407 contactDateComponents. year = Calendar . current. component ( . year, from: Date ( ) )
409408 if let nextNotificationDate = Calendar . current. date ( from: contactDateComponents) {
410- print ( " nextNotificationDate for bee: \( nextNotificationDate) " )
411409 if nextNotificationDate < Date ( ) {
412- print ( " \( Date ( ) ) for bee is greater than \( nextNotificationDate) " )
413- contact. notification_preference_custom_year = Calendar . current. component ( . year, from: Date ( ) ) + 1
410+ contact. notification_preference_custom_year = Calendar . current. component ( . year, from: Date ( ) ) + 1
414411 } else {
415- print ( " \( Date ( ) ) for bee is less than \( nextNotificationDate) " )
416412 contact. notification_preference_custom_year = Calendar . current. component ( . year, from: Date ( ) )
417413 }
418414 print ( " set \( contact. name) 's year preference to \( contact. notification_preference_custom_year) " )
0 commit comments