- Fix NSDate parsing
This commit is contained in:
1 parent
72d6135f67
commit
520b729123
5 files changed
+14
-8
No files matched your search
@@ -118,7 +118,13 @@
|
||||
},
|
||||
@"NSDate" : ^{
|
||||
NSString *str = [NSString stringWithFormat:@"%@", value];
|
||||
NSDate *val = [[NSDate dateFromString:str withFormat:kNSDateHelperFormatSQLDateWithTime] toLocalTime];
|
||||
NSString *dateFormat = [NSDate parseDateFormatFromString:str];
|
||||
|
||||
if (dateFormat == nil) {
|
||||
dateFormat = kNSDateHelperFormatSQLDateWithTime;
|
||||
}
|
||||
|
||||
NSDate *val = [[NSDate dateFromString:str withFormat:dateFormat] toLocalTime];
|
||||
if (![self isObjNull:val]) {
|
||||
[self setValue:val forKey:propertyName];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user