Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: can't edit recurring events #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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