- Fix NSDate parsing

This commit is contained in:
giuseppenuc committed 2017-01-03 23:29:07 +01:00
1 parent 72d6135f67
commit 520b729123
5 files changed
+14 -8

No files matched your search

+7 -1
View File
@@ -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];
}