mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
fix birthday calendar
This commit is contained in:
parent
84396ddce7
commit
02b935f4a9
@ -90,9 +90,10 @@ class OC_Contacts_Hooks{
|
||||
if ($birthday) {
|
||||
$date = new DateTime($birthday);
|
||||
$vevent = new OC_VObject('VEVENT');
|
||||
$vevent->setDateTime('LAST-MODIFIED', new DateTime($vcard->REV));
|
||||
//$vevent->setDateTime('LAST-MODIFIED', new DateTime($vcard->REV));
|
||||
$vevent->setDateTime('DTSTART', $date, Sabre_VObject_Element_DateTime::DATE);
|
||||
$vevent->setString('DURATION', 'P1D');
|
||||
$vevent->setString('UID', substr(md5(rand().time()),0,10));
|
||||
// DESCRIPTION?
|
||||
$vevent->setString('RRULE', 'FREQ=YEARLY');
|
||||
$title = str_replace('{name}', $vcard->getAsString('FN'), OC_Contacts_App::$l10n->t('{name}\'s Birthday'));
|
||||
@ -101,6 +102,7 @@ class OC_Contacts_Hooks{
|
||||
'vevent' => $vevent,
|
||||
'repeating' => true,
|
||||
'summary' => $title,
|
||||
'calendardata' => "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:ownCloud Contacts " . OCP\App::getAppVersion('contacts') . "\n" . $vevent->serialize() . "END:VCALENDAR"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user