Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
Fixes boredzo#64: Set the timeZone and calendar properties of the dat…
Browse files Browse the repository at this point in the history
…e components.
  • Loading branch information
boredzo committed Apr 17, 2016
1 parent 1e9fa17 commit 432657f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ISO8601DateFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,10 @@ - (NSDate *) dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTi
return nil;

parsingCalendar.timeZone = timeZone;
if ([components respondsToSelector:@selector(setTimeZone:)])
components.timeZone = timeZone;
if ([components respondsToSelector:@selector(setCalendar:)])
components.calendar = parsingCalendar;

NSDate *parsedDate = [parsingCalendar dateFromComponents:components];

Expand Down

0 comments on commit 432657f

Please sign in to comment.