1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Use correct class.

This commit is contained in:
Thomas Tanghus 2012-08-14 20:06:22 +02:00
parent 95b72311f5
commit cada857f16
2 changed files with 10 additions and 2 deletions

View File

@ -49,10 +49,14 @@ if(!$id) {
exit();
}
$lastmodified = OC_Contacts_App::lastModified($vcard);
if(!$lastmodified) {
$lastmodified = new DateTime();
}
OCP\JSON::success(array(
'data' => array(
'id' => $id,
'aid' => $aid,
'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U')
'lastmodified' => $lastmodified->format('U')
)
));

View File

@ -50,9 +50,13 @@ if(isset($details['PHOTO'])) {
} else {
$details['PHOTO'] = false;
}
$lastmodified = OC_Contacts_App::lastModified($vcard);
if(!$lastmodified) {
$lastmodified = new DateTime();
}
$details['id'] = $id;
$details['displayname'] = $card['fullname'];
$details['addressbookid'] = $card['addressbookid'];
$details['lastmodified'] = OC_Contacts_App::lastModified($vcard)->format('U');
$details['lastmodified'] = $lastmodified->format('U');
OC_Contacts_App::setLastModifiedHeader($vcard);
OCP\JSON::success(array('data' => $details));