- Fix NSDate in JSONFormObjectMathod
This commit is contained in:
1 parent
4eca983cf6
commit
3afa4a9459
2 files changed
+7
-2
No files matched your search
@@ -348,13 +348,18 @@ NSString * const PNObjectMappingSelector = @"selector";
|
||||
NSDictionary *JSONMap = [[self class] objcetMapping];
|
||||
|
||||
if (self.JSON && [[self.JSON allKeys] count] == 0) {
|
||||
self.JSON = [self reverseMapping];
|
||||
self.JSON = [[NSMutableDictionary alloc] initWithDictionary:[self reverseMapping]];
|
||||
}
|
||||
|
||||
for (NSString *key in JSONMap) {
|
||||
|
||||
if ([self.JSON objectForKey:[JSONMap objectForKey:key]]) {
|
||||
if ([[self.JSON objectForKey:[JSONMap objectForKey:key]] isKindOfClass:[NSDate class]]) {
|
||||
[JSONFormObject setObject:[[[self.JSON objectForKey:[JSONMap objectForKey:key]] toGlobalTime] stringWithFormat:kNSDateHelperFormatSQLDateWithTime] forKey:[JSONMap objectForKey:key]];
|
||||
}
|
||||
else {
|
||||
[JSONFormObject setObject:[self.JSON objectForKey:[JSONMap objectForKey:key]] forKey:[JSONMap objectForKey:key]];
|
||||
}
|
||||
}
|
||||
}
|
||||
return JSONFormObject;
|
||||
|
||||
Reference in new issue
Block a user