-
Notifications
You must be signed in to change notification settings - Fork 269
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
Enable multiple-day allDay events on Android #324
Conversation
Thanks @FCView wish this could be merged soon. Did you figure out any way to fix the issue you mentioned? |
@hyouuu No, never did find a fix for that other issue. I think that is an issue with Android's Calendar Provider, or the way Android handles local Calendars. I restricted my application to only use synced calendars and haven't had time to go back and really dive deep. |
Thanks for the clarification! |
Hi @FCView encountered a bug while using your branch - if you create any all day events in Android system calendar and then retrieve it, the end date timestamp will be UTC 0:00 which means it will be incorrect in all other timezones |
@hyouuu, allday events are stored in the Android system as midnight UTC to midnight UTC the following day (see documentation here). The timezone must be in UTC so there is no way to store a different timezone. Also, storing it in a different timezone causes trouble if the user moves across timezones (as mine do regularly). I suppose that it could be modified to return the dates in local timezones, but that is just an extra step that I think is best left to the developer based on their use-case. I don't remember how the Calendar Provider returns the date, but see the example that I also updated in this branch that shows how to use/display these allday events after retreival: _formatDateTime() in example/lib/presentation/event_item.dart |
Thanks so much! For some reason the start date was in local timezone - will double check what's going on there. |
The code seems to be working, but code should be changed in For example, the end date is fine in events list, but it's incorrect in the datails page because the lib code wasn't fixed. Also, variables in calendar delegate was changed in between your commits so that need to be changed as well. |
@thomassth updated with conflict fix and changed implementation to lib instead of example |
# Conflicts: # android/src/main/kotlin/com/builttoroam/devicecalendar/CalendarDelegate.kt # example/lib/presentation/pages/calendar_add.dart # example/lib/presentation/pages/calendar_event.dart # lib/src/models/event.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on my device:
- add and remove multi-day all day events
- cross-checked results with other calendar apps
A proper integration test would be great but this is working as intended. @FCView great job!
Replaces my previous PR. Updated to current version and enables multiple-day allDay events on Android. Fix for #220 and also possible fix for #323 as this updates the Android allDay events to correctly be posted at midnight UTC instead of local timezone.
This still doesn't address the issue with local calendars vs synced calendars, as I mentioned in my comment here., but I'm not sure that is fixable within the scope of this project.