Skip to content

Commit 3fd4397

Browse files
committed
Fixed get information about every instance of event including recurring events
1 parent 0b1e8ad commit 3fd4397

File tree

2 files changed

+199
-188
lines changed

2 files changed

+199
-188
lines changed

calendar.android.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Calendar._fields = {
1414
LOCATION: "eventLocation",
1515
STARTDATE: "dtstart",
1616
ENDDATE: "dtend",
17+
BEGIN: "begin",
18+
END: "end",
1719
ALLDAY: "allDay",
1820
TIMEZONE: "eventTimezone",
1921
HAS_ALARM: "hasAlarm",
@@ -151,7 +153,10 @@ Calendar._findEvents = function(arg) {
151153
Calendar._fields.LOCATION,
152154
Calendar._fields.STARTDATE,
153155
Calendar._fields.ENDDATE,
154-
Calendar._fields.ALLDAY
156+
Calendar._fields.ALLDAY,
157+
Calendar._fields.RRULE,
158+
Calendar._fields.BEGIN,
159+
Calendar._fields.END
155160
];
156161

157162
var sortOrder = android.provider.CalendarContract.Instances.BEGIN + " ASC, " + android.provider.CalendarContract.Instances.END + " ASC";
@@ -202,7 +207,10 @@ Calendar._findEvents = function(arg) {
202207
calendar: {
203208
id: cursor.getLong(cursor.getColumnIndex(Calendar._fields.CALENDAR.ID)),
204209
name: cursor.getString(cursor.getColumnIndex(Calendar._fields.CALENDAR.NAME))
205-
}
210+
},
211+
recurringRule: cursor.getString(cursor.getColumnIndex(Calendar._fields.RRULE)),
212+
instanceBeginDate: new Date(cursor.getLong(cursor.getColumnIndex(Calendar._fields.BEGIN))),
213+
instanceEndDate: new Date(cursor.getLong(cursor.getColumnIndex(Calendar._fields.END)))
206214
};
207215
events.push(event);
208216
} while (cursor.moveToNext());

0 commit comments

Comments
 (0)