Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-09-17 11:06:19 +0300
committerGitHub <noreply@github.com>2019-09-17 11:06:19 +0300
commitd43a478840ace4cf827643f3254288b66eb75a8a (patch)
tree3a1b980e3d8efcd265d148709520a2f329b7df72 /apps
parent9629015b4bef62898e38f34b5951407f941827cf (diff)
parent3487f0d281ad3eaf1091e95788b2499d82ec4509 (diff)
Merge pull request #17159 from nextcloud/bugfix/17004/birthday_service_fixes
Sabre/VObject returns a DateAndOrTime object now, so adapt to it in Birthday service
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 278373733a4..a4326f54f64 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -243,7 +243,11 @@ class BirthdayService {
}
try {
- $date = new \DateTime($birthday);
+ if ($birthday instanceof DateAndOrTime) {
+ $date = $birthday->getDateTime();
+ } else {
+ $date = new \DateTimeImmutable($birthday);
+ }
} catch (Exception $e) {
return null;
}
@@ -259,10 +263,13 @@ class BirthdayService {
);
$vEvent->DTSTART['VALUE'] = 'DATE';
$vEvent->add('DTEND');
- $date->add(new \DateInterval('P1D'));
+
+ $dtEndDate = (new \DateTime())->setTimestamp($date->getTimeStamp());
+ $dtEndDate->add(new \DateInterval('P1D'));
$vEvent->DTEND->setDateTime(
- $date
+ $dtEndDate
);
+
$vEvent->DTEND['VALUE'] = 'DATE';
$vEvent->{'UID'} = $doc->UID . $postfix;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
@@ -306,7 +313,7 @@ class BirthdayService {
foreach($books as $book) {
$cards = $this->cardDavBackEnd->getCards($book['id']);
foreach($cards as $card) {
- $this->onCardChanged($book['id'], $card['uri'], $card['carddata']);
+ $this->onCardChanged((int) $book['id'], $card['uri'], $card['carddata']);
}
}
}