- Fix NSDate in JSONFormObjectMathod
This commit is contained in:
parent
4eca983cf6
commit
3afa4a9459
@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "PNObject"
|
||||
s.version = "0.8.0"
|
||||
s.version = "0.8.1"
|
||||
s.summary = "PNObject is a simple replica of the more complex ParseObject"
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user