aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2020-11-17 09:20:59 +0100
committerGitHub <noreply@github.com>2020-11-17 09:20:59 +0100
commitce5e60d4b5f607ce47f0180fa2aa7f86de19f7e7 (patch)
treea2aa182e6bbd056d9e4df38d04baa5ff3c6209ae /apps/dav
parent12098f0813b3f5eb31717a1623c80ee2112fbb85 (diff)
parente526e76314e3ad666d4e8a1e4abb8910dfa1b666 (diff)
downloadnextcloud-server-ce5e60d4b5f607ce47f0180fa2aa7f86de19f7e7.tar.gz
nextcloud-server-ce5e60d4b5f607ce47f0180fa2aa7f86de19f7e7.zip
Merge pull request #24108 from csware/apple-unknown-year
Use correct year for generated birthdays events
Diffstat (limited to 'apps/dav')
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php
index 39e8d6c3940..325962dd738 100644
--- a/apps/dav/lib/CalDAV/BirthdayService.php
+++ b/apps/dav/lib/CalDAV/BirthdayService.php
@@ -235,7 +235,12 @@ class BirthdayService {
}
} else {
$originalYear = (int)$dateParts['year'];
-
+ // 'X-APPLE-OMIT-YEAR' is not always present, at least iOS 12.4 uses the hard coded date of 1604 (the start of the gregorian calendar) when the year is unknown
+ if ($originalYear == 1604) {
+ $originalYear = null;
+ $unknownYear = true;
+ $birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
+ }
if ($originalYear < 1970) {
$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
}