-
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
allDay event does not span multiple days #220
Comments
Sounds like a bug with the way that we're setting event start and end dates when it's an all day event. Feel free to open a PR with suggested fix |
I don't know if anyone already looked into this, but what I'm seeing is this on Android:
Could it be that the plugin treats start/end times for all day as UTC, even though is already on my local timezone, and then converts the dates unnecessarily? That would cause what I'm seeing. |
@voivoed , see my pull request ( #256 ) in the Example app for what is going on. Basically, when we create the event, it needs to be from midnight to midngiht. However, when we retrieve the allDay event, the Calendar Provider returns it adjusted to our local timezone, as you mentioned. So, we need to adjust it back to UTC to get the correct start and end dates. My problem was that when using this package to create an allDay event that spans more than one day, this package was only creating it on the first day (it turns out that it was just not setting the end date). That should be fixed in my PR. |
@FCView that's what I had to do, I had to convert it back to get the actual dates, then just use the UTC dates as if they were local. I created the events I needed using the actual device calendar app, my app doesn't create events yet, but may in the future, so hopefully by the time I need it to they'll have merged your PR :-) |
I found another issue, though, that I don't think is fixable within the scope of this package. I think this is an issue with either the Android's Calendar Provider, or the way Android handles local Calendars. When I add an allday event to a Calendar that is not tied to a synced account (I think this is Calendar.accountType == LOCAL, but I am going to look more into it tomorrow), then the allDay event can get pushed into adjacent days on the Device Calendar when the timezone is later changed. For example, if I add a one-day allday event via this package, and then later change timezones, then the event still shows the exact same information, but it is now showing up on two days on the Calendar app (even though no information in the Event has changed and it has the exact same info as a Calendar app-created allday event). The calendar-created allDay event does not spill over into an adjacent day, but allday events created with the exact same information from this package (or more specifically, Android's CalendarContract) will spill over. I'm using spill over, because it will spill over forward or backward depending on which direction your timezone changes. This does not appear to be app-specific as I saw this behavior on both Google's Calendar app and Samsung's Calendar app. For the synced calendars, I used calendars that were synced with both Google and Yahoo and did not see this behavior. Only for a Local calendar. My users travel across timezones a lot, so this is a pretty big issue for me and I may just restrict writing to local calendars until this issue is addressed. I need to do some more digging into this, though. |
Still an issue on iOs |
Hey @vasilich6107 I don't have write access to this repository, so my review won't matter 🙂 |
Thanks @voivoed for quick response I will try to ask |
Can we consider this issue as fixed as per #450 ? |
@henry2man Yes, indeed. This is fixed since 4.3.0. |
I want to be able to create an event that spans several days, and is an All Day event.
Currently, when I try to do so, it only posts to the calendar as a 1-day All Day event on the first day.
When I later call DeviceCalendarPlugin.retrieveEvents(...), I get the event back, but the end date now matches the start date (Event.start == Event.end) and it displays only on that start date on my device calendar.
This is on Android.
The text was updated successfully, but these errors were encountered: