mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-28 12:45:33 +08:00
Add support for mapping of numeric dates encoded in strings via NSNumberFormatter. closes #815
This commit is contained in:
3
Vendor/iso8601parser/ISO8601DateFormatter.m
vendored
3
Vendor/iso8601parser/ISO8601DateFormatter.m
vendored
@@ -613,7 +613,7 @@ static BOOL is_leap_year(NSUInteger year);
|
||||
*outTimeZone = timeZone;
|
||||
}
|
||||
|
||||
return components;
|
||||
return isValidDate ? components : nil;
|
||||
}
|
||||
|
||||
- (NSDate *) dateFromString:(NSString *)string {
|
||||
@@ -625,6 +625,7 @@ static BOOL is_leap_year(NSUInteger year);
|
||||
- (NSDate *)dateFromString:(NSString *)string timeZone:(out NSTimeZone **)outTimeZone range:(out NSRange *)outRange {
|
||||
NSTimeZone *timeZone = nil;
|
||||
NSDateComponents *components = [self dateComponentsFromString:string timeZone:&timeZone range:outRange];
|
||||
if (! components) return nil;
|
||||
if (outTimeZone)
|
||||
*outTimeZone = timeZone;
|
||||
parsingCalendar.timeZone = timeZone;
|
||||
|
||||
Reference in New Issue
Block a user