Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed All day events start time may be incorrect (iOS only) #337 #450

Merged
merged 3 commits into from
Nov 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ios/Classes/SwiftDeviceCalendarPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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

ekEvent!.endDate = endDate

if (!isAllDay) {
let timeZone = TimeZone(identifier: startTimeZoneString ?? TimeZone.current.identifier) ?? .current
ekEvent!.timeZone = timeZone
}

ekEvent!.calendar = ekCalendar!
ekEvent!.location = location

Expand Down