Add support for mapping of numeric dates encoded in strings via NSNumberFormatter. closes #815

This commit is contained in:
Blake Watters
2012-09-25 21:18:03 -04:00
parent 618b1e094c
commit e56754cb65
3 changed files with 6 additions and 1 deletions

View File

@@ -116,6 +116,9 @@ extern NSString * const RKObjectMappingNestingAttributeKeyName;
if ([dateFormatter isKindOfClass:[NSDateFormatter class]]) {
RKLogTrace(@"Successfully parsed string '%@' with format string '%@' and time zone '%@' and turned into date '%@'",
string, [(NSDateFormatter *)dateFormatter dateFormat], [(NSDateFormatter *)dateFormatter timeZone], date);
} else if ([dateFormatter isKindOfClass:[NSNumberFormatter class]]) {
NSNumber *formattedNumber = (NSNumber *)date;
date = [NSDate dateWithTimeIntervalSince1970:[formattedNumber doubleValue]];
}
break;