From 93052def01244efd723c2cd139cddaa1c53fe42f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 00:07:25 +0000 Subject: [PATCH] Notifiche: fuso esplicito nel trigger, l'avviso non si sposta viaggiando (#13) Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AVhvvL1jA91sbfcWkV2Zjj --- CalenTask/Services/NotificationService.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CalenTask/Services/NotificationService.swift b/CalenTask/Services/NotificationService.swift index 5eb342b..f527597 100644 --- a/CalenTask/Services/NotificationService.swift +++ b/CalenTask/Services/NotificationService.swift @@ -230,9 +230,12 @@ final class NotificationService { // quello richiede un entitlement speciale di Apple). content.interruptionLevel = isUrgent ? .timeSensitive : .active content.userInfo = ["taskID": taskID.uuidString] - let components = Calendar.app.dateComponents( + var components = Calendar.app.dateComponents( [.year, .month, .day, .hour, .minute], from: fireDate ) + // #13 — fuso esplicito: senza, il sistema reinterpreta l'orario nel + // fuso del momento dello scatto e un viaggio sposta l'avviso. + components.timeZone = Calendar.app.timeZone let trigger = UNCalendarNotificationTrigger(dateMatching: components, repeats: false) return UNNotificationRequest(identifier: id, content: content, trigger: trigger) }