-
Notifications
You must be signed in to change notification settings - Fork 267
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
Spanning all day events can't be saved properly in iOS #451
Comments
This should be fixed by #450. In case I misunderstood something here, could you please elaborate where it goes wrong?
|
Is the event correctly saved to the calendar, but importing it again results in the issue? (this should be fixed by the PR above) It is the saving in iOS, saving in android is ok. Importing an all day event spanning multiple days works just fine. It is in the file SwiftDeviceCalendarPlugin.swift where it seems to go wrong in the method... private func createOrUpdateEvent(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { where the lines... if (isAllDay) { ekEvent!.endDate = startDate } are setting the end date to the start date. |
Have you looked at the changes made in this PR? I just double checked and as far as I can tell, exactly the lines you pointed out are changed. And pretty much in the way you suggested. |
Have you looked at the changes made in #450? No, I did not go into the code, but I have done now, and I agree - it looks good! I am a total newbee when it comes to using github, I don't even know what a PR is... So please apologise if I confuse things or ask stupid questions. Will this then come in the next release of device_calendar? Or can I get a beta (pre release = PR??) somewhere? |
Ohh right, sry for using acronyms. PR stands for pull request, which is a collection of commits that some developer wants to merge into (i.e. add to) the main codebase. This will most likely come in the next release of You can also specify a specific Github repository in your If you have any trouble, just reply here and I can try to help. |
Ah, thanks. Great with the link on how to add specific repositories. Didn't know that. Thanks a lot! |
I faced version solving failed because depends on timezone ^0.9.0, when are you planning to update the version ? |
this should be fixed since version 4.3.0. @SuperKrallan could you test if the issue still exists on your side? |
With the 4.3.0 (and the required timezone: ^0.9.0) it now works great! Tested on both iPhone simulator and my real iPhone. Thanks a lot! Much appreciated! |
Saving an event with allDay = true and where end date are some days after start date works fine for android, but the same flutter code run on iOS results in change in the end date to the same as the start date.
in the file SwiftDeviceCalendarPlugin.swift line 818-820 you see this:
if (isAllDay) { ekEvent!.endDate = startDate }
else {
ekEvent!.endDate = endDate_
...and that if statement makes very little sense to me. If I remove the first part it works as it should...
To Reproduce
Save any "all day" event spanning more than one day will result in this error in iOS, but not on Android.
Expected behavior
Same as on android and in all other calendar apps I have seen, that the all day event is present on all days in the time span.
Device(s) tested
Flutter doctor
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 3.4.0-34.1.pre, on macOS 12.6 21G115 darwin-arm64, locale sv-SE)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
• No issues found!
Additional context
Thanks for a great plug in!!
The text was updated successfully, but these errors were encountered: