Skip to content

Commit fbaa48c

Browse files
Merge pull request #27 from shabib3/master
fixed bug of getting information about recurring events
2 parents 0b1e8ad + 12bbebe commit fbaa48c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
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());

index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ declare module "nativescript-calendar" {
155155
endDate: Date;
156156
allDay: boolean;
157157
calendar: Calendar;
158+
instanceBeginDate: Date;
159+
instanceEndDate: Date;
160+
recurringRule: string;
158161
/**
159162
* iOS only.
160163
*/

0 commit comments

Comments
 (0)