Skip to content

Commit 316a983

Browse files
Merge pull request #337 from echonox/master
Retrieve more info for Recurring Events
2 parents 56819c7 + 6c51eee commit 316a983

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/android/nl/xservices/plugins/Calendar.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ public void run() {
585585
calendar_end.setTime(date_end);
586586

587587
//projection of DB columns
588-
String[] l_projection = new String[]{"calendar_id", "title", "begin", "end", "eventLocation", "allDay", "_id"};
588+
String[] l_projection = new String[]{"calendar_id", "title", "begin", "end", "eventLocation", "allDay", "_id", "rrule", "rdate", "exdate", "event_id"};
589589

590590
//actual query
591591
Cursor cursor = contentResolver.query(
@@ -610,7 +610,11 @@ public void run() {
610610
i++,
611611
new JSONObject()
612612
.put("calendar_id", cursor.getString(cursor.getColumnIndex("calendar_id")))
613-
.put("event_id", cursor.getString(cursor.getColumnIndex("_id")))
613+
.put("id", cursor.getString(cursor.getColumnIndex("_id")))
614+
.put("event_id", cursor.getString(cursor.getColumnIndex("event_id")))
615+
.put("rrule", cursor.getString(cursor.getColumnIndex("rrule")))
616+
.put("rdate", cursor.getString(cursor.getColumnIndex("rdate")))
617+
.put("exdate", cursor.getString(cursor.getColumnIndex("exdate")))
614618
.put("title", cursor.getString(cursor.getColumnIndex("title")))
615619
.put("dtstart", cursor.getLong(cursor.getColumnIndex("begin")))
616620
.put("dtend", cursor.getLong(cursor.getColumnIndex("end")))

src/ios/Calendar.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ - (void) initEventStoreWithCalendarCapabilities {
2828
} else { // we're on iOS 5 or older
2929
accessGranted = YES;
3030
}
31-
31+
3232
if (accessGranted) {
3333
self.eventStore = eventStoreCandidate;
3434
}
@@ -375,6 +375,7 @@ - (NSMutableArray*) eventsToDataArray: (NSArray*)matchingEvents {
375375
NSMutableDictionary *entry = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
376376
event.title, @"title",
377377
event.calendar.title, @"calendar",
378+
event.eventIdentifier, @"id",
378379
[df stringFromDate:event.startDate], @"startDate",
379380
[df stringFromDate:event.endDate], @"endDate",
380381
[df stringFromDate:event.lastModifiedDate], @"lastModifiedDate",
@@ -406,6 +407,10 @@ - (NSMutableArray*) eventsToDataArray: (NSArray*)matchingEvents {
406407
[entry setObject:attendees forKey:@"attendees"];
407408
}
408409

410+
if (event.recurrenceRules != nil) {
411+
[entry setObject:event.recurrenceRules forKey:@"rrule"];
412+
}
413+
409414
[entry setObject:event.calendarItemIdentifier forKey:@"id"];
410415
[results addObject:entry];
411416
}

0 commit comments

Comments
 (0)