Skip to content

Commit 0282d5e

Browse files
adding default timezone
1 parent 93fd1ed commit 0282d5e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

CalendarManager/CalendarEventParser.m

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ @implementation CalendarEventParser
1414

1515
+(void)parseCalendar:(NSString *)icalEventString :(void (^)(CalendarEvent *))successBlock withErrorBlock:(void (^)(NSDictionary*))errorBlock
1616
{
17-
CalendarEvent *event = [self getCalendarEventComponents:icalEventString];
18-
if(event) {
19-
successBlock(event);
20-
}else {
17+
if(icalEventString){
18+
CalendarEvent *event = [self getCalendarEventComponents:icalEventString];
19+
if(event) {
20+
successBlock(event);
21+
}else {
22+
errorBlock(nil);
23+
};
24+
}else{
2125
errorBlock(nil);
22-
};
26+
}
2327
}
2428

2529
+(CalendarEvent *)getCalendarEventComponents:(NSString *)icsString

CalendarManager/CalendarEventTimeZones.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ +(NSTimeZone *)getTimezoneById:(NSString *)timezoneId
166166
});
167167

168168
NSString *timezoneName = [timeZoneMap valueForKey:timezoneId];
169-
return timezoneName.length != 0 ? [NSTimeZone timeZoneWithName:timezoneName] : nil;
169+
return timezoneName.length != 0 ? [NSTimeZone timeZoneWithName:timezoneName] : [NSTimeZone timeZoneForSecondsFromGMT:0];
170170
}
171171

172172
@end

0 commit comments

Comments
 (0)