[TIMOB-24464] Android: Ti.Calendar.Calendar.getEventsBetweenDates returns same events for all calendars
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-02T00:13:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | android |
Reporter | Kiley Williams |
Assignee | Hans Knöchel |
Created | 2016-12-14T17:26:17.000+0000 |
Updated | 2018-02-21T10:41:53.000+0000 |
Description
On my test device, there are 15 calendars, some are duplicates (via being linked through different google accounts on the same device), and some are not duplicates.
Let X be the events returned from the first calendar. When executing the "Ti.Calendar.Calendar.getEventsBetweenDates" method on all calendars, they all return X. This is problematic, because we then cannot differentiate between which Calendars from which data is being pulled. A use cannot exclude certain calendars from being consumed by the application, which is a major issue.
NOTE: On iOS, this exact same scenario and code results in the proper data being returned from the specific Calendars.
Hello, Please share a sample code to test the issue.
Hello, Your sample code is not sufficient enough. Please attach a sample project that regenerates the issue. Thanks.
Sharif, this was unnecessarily closed, and I was not about to rewrite an entire test application for you. It's an easy check to see (by using your sample code from the Appcelerator documentation site) that the calendars yield the same results, even if you specify them explicitly. In my case, no matter if I chose 1 or 15 calendars, it still yielded the same result. See line 240 of EventProxy.java in the titanium_mobile SDK.
return queryEventsBetweenDates(date1, date2, null, null);
should actually bereturn queryEventsBetweenDates(date1, date2, "calendar_id=" + calendar.getId(), null);
I'm not submitting a PR and all of that jazz for this, because it can be resolved by one of you quite quickly. There's your answer, I made the change myself in my customized SDK and it works fine.Reopening issue, it's valid and reproducible.
Community-PR: https://github.com/appcelerator/titanium_mobile/pull/8867
Thanks
FR passed for 6.2.0. Need a backport for 6.1.0.
PR (6_1_X): https://github.com/appcelerator/titanium_mobile/pull/9042
Verified the fix with 6.1.0.v20170514022959 & 6.2.0.v20170512073825.
calendar.getEventsBetweenDates
returns correct number of events. Closing. Studio Ver: 4.9.0.201705110256 SDK Ver: 6.1.0.v20170514022959 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.2 Appc NPM: 4.2.9 Appc CLI: 6.2.1 Ti CLI Ver: 5.0.13 Alloy Ver: 1.9.11 Node Ver: 6.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 6 --- Android 6.0.1 ⇨ google Nexus 6P --- Android 7.1.1On SDK 7.0.2.GA all events have the same id when calling getEventsBetweenDates(). When calling getEventsInDate() the have the correct id's.