Permalink
Browse files

Snow Leopard is less lenient than Mountain Lion for interpreting date…

… formats.
  • Loading branch information...
1 parent dbd8c5c commit 23ec44d7742868b9d6d9c269db162a7f3f36a1ee @barijaona barijaona committed Dec 31, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 src/AppController.m
View
@@ -128,7 +128,7 @@ @implementation AppController
// C array of NSDateFormatter's : creating a NSDateFormatter is very expensive, so we create
// those we need early in the program launch and keep them in memory.
-#define kNumberOfDateFormatters 4
+#define kNumberOfDateFormatters 6
static NSDateFormatter * dateFormatterArray[kNumberOfDateFormatters];
static NSLock * dateFormatters_lock;
@@ -1008,12 +1008,15 @@ + (void) initialize
//For the different date formats, see <http://unicode.org/reports/tr35/#Date_Format_Patterns>
// 2010-09-28T15:31:25Z and 2010-09-28T17:31:25+02:00
- [dateFormatterArray[0] setDateFormat:@"yyyy-MM-dd'T'HH:mm:sszzz"];
+ [dateFormatterArray[0] setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZ"];
// 2010-09-28T15:31:25.815+02:00
- [dateFormatterArray[2] setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSzzz"];
+ [dateFormatterArray[1] setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSZZZ"];
// "Sat, 13 Dec 2008 18:45:15 EAT" and "Fri, 12 Dec 2008 18:45:15 -08:00"
- [dateFormatterArray[1] setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"];
- [dateFormatterArray[3] setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss"];
+ [dateFormatterArray[2] setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss ZZZ"];
+ [dateFormatterArray[3] setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"];
+ [dateFormatterArray[4] setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss"];
+ // Other exotic date formats
+ [dateFormatterArray[5] setDateFormat:@"yyyy-MM-dd HH:mm:ss ZZZ"];
[enUS release];
// end of initialization of date formatters

0 comments on commit 23ec44d

Please sign in to comment.