From 53ac92fad21398daa4a231cbefb51e6f34aa3a19 Mon Sep 17 00:00:00 2001 From: Oleksandra Fedotova Date: Thu, 13 Oct 2022 12:11:52 +0300 Subject: [PATCH 1/3] Fix create/update events in IOS Fixed fullDay with DateRange events creation (not only one fullday events possible to create) Timezone should be set only if event is not full day --- ios/Classes/SwiftDeviceCalendarPlugin.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Classes/SwiftDeviceCalendarPlugin.swift b/ios/Classes/SwiftDeviceCalendarPlugin.swift index b39ee5da..fdad5ecc 100644 --- a/ios/Classes/SwiftDeviceCalendarPlugin.swift +++ b/ios/Classes/SwiftDeviceCalendarPlugin.swift @@ -815,13 +815,13 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin, EKEventViewDele ekEvent!.notes = description ekEvent!.isAllDay = isAllDay ekEvent!.startDate = startDate - if (isAllDay) { ekEvent!.endDate = startDate } - else { - ekEvent!.endDate = endDate - - let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current + ekEvent!.endDate = endDate + + if (!isAllDay) { + let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current ekEvent!.timeZone = timeZone - } + } + ekEvent!.calendar = ekCalendar! ekEvent!.location = location From bd290e8a0cd465099b12cc04f3bfb244706b801b Mon Sep 17 00:00:00 2001 From: Oleksandra Fedotova Date: Mon, 17 Oct 2022 12:50:37 +0300 Subject: [PATCH 2/3] Fixed formatting --- ios/Classes/SwiftDeviceCalendarPlugin.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Classes/SwiftDeviceCalendarPlugin.swift b/ios/Classes/SwiftDeviceCalendarPlugin.swift index fdad5ecc..cb102cd2 100644 --- a/ios/Classes/SwiftDeviceCalendarPlugin.swift +++ b/ios/Classes/SwiftDeviceCalendarPlugin.swift @@ -815,12 +815,12 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin, EKEventViewDele ekEvent!.notes = description ekEvent!.isAllDay = isAllDay ekEvent!.startDate = startDate - ekEvent!.endDate = endDate + ekEvent!.endDate = endDate if (!isAllDay) { - let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current + let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current ekEvent!.timeZone = timeZone - } + } ekEvent!.calendar = ekCalendar! ekEvent!.location = location From d3d39271e8f99dafefa3cf3abd45070a84f9e22d Mon Sep 17 00:00:00 2001 From: Oleksandra Fedotova Date: Mon, 17 Oct 2022 19:33:08 +0300 Subject: [PATCH 3/3] Fixed file formatting with spaces --- ios/Classes/SwiftDeviceCalendarPlugin.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/Classes/SwiftDeviceCalendarPlugin.swift b/ios/Classes/SwiftDeviceCalendarPlugin.swift index cb102cd2..ed8d6fb7 100644 --- a/ios/Classes/SwiftDeviceCalendarPlugin.swift +++ b/ios/Classes/SwiftDeviceCalendarPlugin.swift @@ -440,13 +440,13 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin, EKEventViewDele private func convertEkEventStatus(ekEventStatus: EKEventStatus?) -> EventStatus? { switch ekEventStatus { case .confirmed: - return EventStatus.CONFIRMED + return EventStatus.CONFIRMED case .tentative: return EventStatus.TENTATIVE - case .canceled: - return EventStatus.CANCELED - case .none?: - return EventStatus.NONE + case .canceled: + return EventStatus.CANCELED + case .none?: + return EventStatus.NONE default: return nil } @@ -817,7 +817,7 @@ public class SwiftDeviceCalendarPlugin: NSObject, FlutterPlugin, EKEventViewDele ekEvent!.startDate = startDate ekEvent!.endDate = endDate - if (!isAllDay) { + if (!isAllDay) { let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current ekEvent!.timeZone = timeZone }