Skip to content

Commit

Permalink
Remove rounding up when rescheduling reminders
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerwreah committed Nov 2, 2024
1 parent acc6872 commit bd0296f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Calendr/Events/ContextMenu/ReminderOptionsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ class ReminderOptionsViewModel: BaseContextMenuViewModel<ReminderAction> {
return calendarService.completeReminder(id: event.id, complete: true)

case .remind(let dateComponents):
let date = dateProvider.calendar.date(byAdding: dateComponents, to: dateProvider.now)!
guard
let truncated = dateProvider.calendar.dateInterval(of: .minute, for: dateProvider.now)?.start,
let date = dateProvider.calendar.date(byAdding: dateComponents, to: truncated)
else {
return .empty()
}
return calendarService.rescheduleReminder(id: event.id, to: date)
}
}
Expand Down

0 comments on commit bd0296f

Please sign in to comment.