Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/dav/lib/CalDAV/BirthdayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,12 @@ public function buildDateFromContact(string $cardData,
}
} 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'];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be omitted as $originalYear = null; triggers if ($originalYear < 1970) { below?
Or it should be an elseif to be more explicit?

}
if ($originalYear < 1970) {
$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
}
Expand Down