Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions ios/RNCalendarEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ - (NSDictionary *)buildAndSaveEvent:(NSDictionary *)details options:(NSDictionar
NSString *timeZone = [RCTConvert NSString:details[_timeZone]];

if (eventId) {
Boolean futureEvents = [RCTConvert BOOL:options[@"futureEvents"]];
BOOL futureEvents = [RCTConvert BOOL:options[@"futureEvents"]];
NSDate *exceptionDate = [RCTConvert NSDate:options[@"exceptionDate"]];

if(exceptionDate) {
Expand Down Expand Up @@ -238,11 +238,14 @@ - (NSDictionary *)saveEvent:(EKEvent *)calendarEvent options:(NSDictionary *)opt
{
NSMutableDictionary *response = [NSMutableDictionary dictionaryWithDictionary:@{@"success": [NSNull null], @"error": [NSNull null]}];
NSDate *exceptionDate = [RCTConvert NSDate:options[@"exceptionDate"]];
EKSpan eventSpan = EKSpanFutureEvents;
BOOL futureEvents = [RCTConvert BOOL:options[@"futureEvents"]];

EKSpan eventSpan = EKSpanThisEvent;

if (exceptionDate) {
calendarEvent.startDate = exceptionDate;
eventSpan = EKSpanThisEvent;
if (futureEvents) {
eventSpan = EKSpanFutureEvents;
}
}

NSError *error = nil;
Expand Down Expand Up @@ -1043,7 +1046,7 @@ - (NSDictionary *)serializeCalendarEvent:(EKEvent *)event
@try {
RNCalendarEvents *strongSelf = weakSelf;

Boolean futureEvents = [RCTConvert BOOL:options[@"futureEvents"]];
BOOL futureEvents = [RCTConvert BOOL:options[@"futureEvents"]];
NSDate *exceptionDate = [RCTConvert NSDate:options[@"exceptionDate"]];

if (exceptionDate) {
Expand Down