mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-16 18:58:50 +00:00
@@ -31,6 +31,7 @@
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
|
||||
|
||||
#import <SOGo/CardElement+SOGo.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
@@ -341,7 +342,6 @@ static Class SOGoContactGCSEntryK = Nil;
|
||||
NSMutableArray *units, *categories;
|
||||
NSCalendarDate *date;
|
||||
id o;
|
||||
int seconds;
|
||||
unsigned int i, year, month, day;
|
||||
|
||||
[card setNWithFamily: [attributes objectForKey: @"c_sn"]
|
||||
@@ -357,10 +357,10 @@ static Class SOGoContactGCSEntryK = Nil;
|
||||
setSingleValue: [attributes objectForKey: @"c_screenname"]
|
||||
forKey: @""];
|
||||
|
||||
seconds = [[NSString stringWithFormat: @"%@", [attributes objectForKey: @"birthday"]] intValue];
|
||||
if (seconds != 0)
|
||||
o = [attributes objectForKey: @"birthday"];
|
||||
if ([o isKindOfClass: [NSString class]] && [o length])
|
||||
{
|
||||
date = [NSCalendarDate dateWithTimeIntervalSince1970: seconds];
|
||||
date = [card dateFromString: o inContext: context];
|
||||
year = [date yearOfCommonEra];
|
||||
month = [date monthOfYear];
|
||||
day = [date dayOfMonth];
|
||||
|
||||
@@ -875,7 +875,7 @@
|
||||
o = [card birthday];
|
||||
if (o)
|
||||
{
|
||||
[data setObject: [NSNumber numberWithInt: [o timeIntervalSince1970]]
|
||||
[data setObject: [o descriptionWithCalendarFormat: @"%Y-%m-%d"]
|
||||
forKey: @"birthday"];
|
||||
}
|
||||
|
||||
|
||||
@@ -470,9 +470,10 @@
|
||||
_this.refs[i] = new Card(o);
|
||||
});
|
||||
if (_this.birthday) {
|
||||
_this.birthday = new Date(_this.birthday * 1000);
|
||||
Card.$Preferences.ready().then(function() {
|
||||
_this.$birthday = Card.$Preferences.$mdDateLocaleProvider.formatDate(_this.birthday);
|
||||
var dlp = Card.$Preferences.$mdDateLocaleProvider;
|
||||
_this.birthday = _this.birthday.parseDate(dlp, '%Y-%m-%d');
|
||||
_this.$birthday = dlp.formatDate(_this.birthday);
|
||||
});
|
||||
}
|
||||
// Mark card as loaded
|
||||
@@ -510,9 +511,9 @@
|
||||
// We convert back our birthday object
|
||||
if (!deep) {
|
||||
if (card.birthday)
|
||||
card.birthday = card.birthday.getTime()/1000;
|
||||
card.birthday = card.birthday.format(Card.$Preferences.$mdDateLocaleProvider, '%Y-%m-%d');
|
||||
else
|
||||
card.birthday = 0;
|
||||
card.birthday = '';
|
||||
}
|
||||
|
||||
return card;
|
||||
|
||||
Reference in New Issue
Block a user