diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-07-16 23:36:11 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-07-16 23:44:18 +0200 |
commit | f128b96ac0e0bf659ae818e6b6d190b3fbbe18f7 (patch) | |
tree | dea1c5496cb4b8933d368fd9ccb9e48385b5c412 /apps | |
parent | 47566b0c4282d49347e7a12f2df1ab38a1966ac8 (diff) | |
download | nextcloud-server-f128b96ac0e0bf659ae818e6b6d190b3fbbe18f7.tar.gz nextcloud-server-f128b96ac0e0bf659ae818e6b6d190b3fbbe18f7.zip |
Format birthday as BDAY;VALUE=DATE:YYYY-MM-DD. Fixes oc-1276.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/contacts/ajax/saveproperty.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php index 34fc3cc5351..5a0a7c14882 100644 --- a/apps/contacts/ajax/saveproperty.php +++ b/apps/contacts/ajax/saveproperty.php @@ -66,8 +66,7 @@ if($element != $name) { switch($element) { case 'BDAY': $date = New DateTime($value); - //$vcard->setDateTime('BDAY', $date, Sabre_VObject_Element_DateTime::DATE); - $value = $date->format(DateTime::ATOM); + $value = $date->format('Y-m-d'); break; case 'FN': if(!$value) { @@ -89,6 +88,14 @@ if(!$value) { } else { /* setting value */ switch($element) { + case 'BDAY': + // I don't use setDateTime() because that formats it as YYYYMMDD instead of YYYY-MM-DD + // which is what the RFC recommends. + $vcard->children[$line]->setValue($value); + $vcard->children[$line]->parameters = array(); + $vcard->children[$line]->add(new Sabre_VObject_Parameter('VALUE', 'DATE')); + debug('Setting value:'.$name.' '.$vcard->children[$line]); + break; case 'CATEGORIES': debug('Setting string:'.$name.' '.$value); $vcard->children[$line]->setValue($value); |