Skip to content

Conversation

@csware
Copy link
Contributor

@csware csware commented Nov 13, 2020

'X-APPLE-OMIT-YEAR' is not always present, at least iOS 12.4 uses the hard coded date of 1604 when the year is unknown.

Without this PR people are shown as born in 1604 if not year is entered.

cf. https://forums.bitfire.at/topic/2050/bday-without-year-for-vcard-3-0-if-server-drops-property-x-apple-omit-year and https://gitlab.com/CardBook/CardBook/-/issues/586

Also needed for older Nextcloud versions such as 19

'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.

cf. https://forums.bitfire.at/topic/2050/bday-without-year-for-vcard-3-0-if-server-drops-property-x-apple-omit-year and https://gitlab.com/CardBook/CardBook/-/issues/586

Signed-off-by: Sven Strickroth <[email protected]>
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

oo man... 🍎

Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

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

🙈

@skjnldsv skjnldsv merged commit ce5e60d into nextcloud:master Nov 17, 2020
if ($originalYear == 1604) {
$originalYear = null;
$unknownYear = true;
$birthday = '1970-' . $dateParts['month'] . '-' . $dateParts['date'];
Copy link
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?

@csware
Copy link
Contributor Author

csware commented Nov 17, 2020

Thanks, please also backport this to NC19

@csware csware deleted the apple-unknown-year branch November 17, 2020 09:24
@csware
Copy link
Contributor Author

csware commented Nov 20, 2020

/backport to stable19

@csware
Copy link
Contributor Author

csware commented Nov 20, 2020

/backport to stable20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants