* 'master' of https://github.com/giuseppenucifora/NSDate_Utils:
  - Fix ParseDateFormat
This commit is contained in:
giuseppenuc committed 2017-01-04 12:03:38 +01:00
commit e86571f3c8
8 files changed
+16 -18

No files matched your search

+4 -6
View File
@@ -534,12 +534,10 @@ static NSDateFormatter *_displayFormatter = nil;
[dateFormatter setDateFormat:dateFormat];
NSDate *theDate = nil;
NSError *error = nil;
if (![dateFormatter getObjectValue:&theDate forString:dateString range:nil error:&error]) {
NSLog(@"Date '%@' could not be parsed: %@", dateString, error);
}
else {
NSDate *theDate = [NSDate dateFromString:dateString withFormat:dateFormat];
if (theDate) {
return dateFormat;
}
}