Merge pull request #24108 from csware/apple-unknown-year

Use correct year for generated birthdays events
This commit is contained in:
John Molakvoæ 2020-11-17 09:20:59 +01:00 committed by GitHub
commit ce5e60d4b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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'];
}