Handle birthday dates before 1970

This commit is contained in:
Francis Lachapelle
2016-02-05 16:39:33 -05:00
parent 9f7c205da9
commit 9e905b43ff
4 changed files with 20 additions and 17 deletions
+3 -2
View File
@@ -349,7 +349,8 @@ static Class SOGoContactGCSEntryK = Nil;
NSMutableArray *units, *categories;
NSCalendarDate *date;
id o;
unsigned int i, year, month, day, seconds;
int seconds;
unsigned int i, year, month, day;
[card setNWithFamily: [attributes objectForKey: @"c_sn"]
given: [attributes objectForKey: @"c_givenname"]
@@ -365,7 +366,7 @@ static Class SOGoContactGCSEntryK = Nil;
forKey: @""];
seconds = [[NSString stringWithFormat: @"%@", [attributes objectForKey: @"birthday"]] intValue];
if (seconds > 0)
if (seconds != 0)
{
date = [NSCalendarDate dateWithTimeIntervalSince1970: seconds];
year = [date yearOfCommonEra];