replace coffin with textual description "Death of ..."

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2019-08-21 10:35:17 +02:00
parent af8abab4b3
commit befe38e1d7
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
2 changed files with 173 additions and 77 deletions

View File

@ -1,7 +1,8 @@
<?php <?php
declare(strict_types=1);
/** /**
* @copyright Copyright (c) 2016, ownCloud, Inc. * @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2016, Georg Ehrke * @copyright Copyright (c) 2019, Georg Ehrke
* *
* @author Achim Königs <garfonso@tratschtante.de> * @author Achim Königs <garfonso@tratschtante.de>
* @author Georg Ehrke <oc.list@georgehrke.com> * @author Georg Ehrke <oc.list@georgehrke.com>
@ -33,6 +34,7 @@ use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\DAV\GroupPrincipalBackend; use OCA\DAV\DAV\GroupPrincipalBackend;
use OCP\IConfig; use OCP\IConfig;
use OCP\IDBConnection; use OCP\IDBConnection;
use OCP\IL10N;
use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VCard; use Sabre\VObject\Component\VCard;
use Sabre\VObject\DateTimeParser; use Sabre\VObject\DateTimeParser;
@ -41,6 +43,11 @@ use Sabre\VObject\InvalidDataException;
use Sabre\VObject\Property\VCard\DateAndOrTime; use Sabre\VObject\Property\VCard\DateAndOrTime;
use Sabre\VObject\Reader; use Sabre\VObject\Reader;
/**
* Class BirthdayService
*
* @package OCA\DAV\CalDAV
*/
class BirthdayService { class BirthdayService {
const BIRTHDAY_CALENDAR_URI = 'contact_birthdays'; const BIRTHDAY_CALENDAR_URI = 'contact_birthdays';
@ -60,20 +67,31 @@ class BirthdayService {
/** @var IDBConnection */ /** @var IDBConnection */
private $dbConnection; private $dbConnection;
/** @var IL10N */
private $l10n;
/** /**
* BirthdayService constructor. * BirthdayService constructor.
* *
* @param CalDavBackend $calDavBackEnd * @param CalDavBackend $calDavBackEnd
* @param CardDavBackend $cardDavBackEnd * @param CardDavBackend $cardDavBackEnd
* @param GroupPrincipalBackend $principalBackend * @param GroupPrincipalBackend $principalBackend
* @param IConfig $config; * @param IConfig $config
* @param IDBConnection $dbConnection
* @param IL10N $l10n
*/ */
public function __construct(CalDavBackend $calDavBackEnd, CardDavBackend $cardDavBackEnd, GroupPrincipalBackend $principalBackend, IConfig $config, IDBConnection $dbConnection) { public function __construct(CalDavBackend $calDavBackEnd,
CardDavBackend $cardDavBackEnd,
GroupPrincipalBackend $principalBackend,
IConfig $config,
IDBConnection $dbConnection,
IL10N $l10n) {
$this->calDavBackEnd = $calDavBackEnd; $this->calDavBackEnd = $calDavBackEnd;
$this->cardDavBackEnd = $cardDavBackEnd; $this->cardDavBackEnd = $cardDavBackEnd;
$this->principalBackend = $principalBackend; $this->principalBackend = $principalBackend;
$this->config = $config; $this->config = $config;
$this->dbConnection = $dbConnection; $this->dbConnection = $dbConnection;
$this->l10n = $l10n;
} }
/** /**
@ -81,7 +99,9 @@ class BirthdayService {
* @param string $cardUri * @param string $cardUri
* @param string $cardData * @param string $cardData
*/ */
public function onCardChanged($addressBookId, $cardUri, $cardData) { public function onCardChanged(int $addressBookId,
string $cardUri,
string $cardData) {
if (!$this->isGloballyEnabled()) { if (!$this->isGloballyEnabled()) {
return; return;
} }
@ -90,10 +110,11 @@ class BirthdayService {
$book = $this->cardDavBackEnd->getAddressBookById($addressBookId); $book = $this->cardDavBackEnd->getAddressBookById($addressBookId);
$targetPrincipals[] = $book['principaluri']; $targetPrincipals[] = $book['principaluri'];
$datesToSync = [ $datesToSync = [
['postfix' => '', 'field' => 'BDAY', 'symbol' => '*', 'utfSymbol' => '🎂'], ['postfix' => '', 'field' => 'BDAY'],
['postfix' => '-death', 'field' => 'DEATHDATE', 'symbol' => "", 'utfSymbol' => '⚰️'], ['postfix' => '-death', 'field' => 'DEATHDATE'],
['postfix' => '-anniversary', 'field' => 'ANNIVERSARY', 'symbol' => "", 'utfSymbol' => '💍'], ['postfix' => '-anniversary', 'field' => 'ANNIVERSARY'],
]; ];
foreach ($targetPrincipals as $principalUri) { foreach ($targetPrincipals as $principalUri) {
if (!$this->isUserEnabled($principalUri)) { if (!$this->isUserEnabled($principalUri)) {
continue; continue;
@ -101,7 +122,7 @@ class BirthdayService {
$calendar = $this->ensureCalendarExists($principalUri); $calendar = $this->ensureCalendarExists($principalUri);
foreach ($datesToSync as $type) { foreach ($datesToSync as $type) {
$this->updateCalendar($cardUri, $cardData, $book, $calendar['id'], $type); $this->updateCalendar($cardUri, $cardData, $book, (int) $calendar['id'], $type);
} }
} }
} }
@ -110,7 +131,8 @@ class BirthdayService {
* @param int $addressBookId * @param int $addressBookId
* @param string $cardUri * @param string $cardUri
*/ */
public function onCardDeleted($addressBookId, $cardUri) { public function onCardDeleted(int $addressBookId,
string $cardUri) {
if (!$this->isGloballyEnabled()) { if (!$this->isGloballyEnabled()) {
return; return;
} }
@ -136,7 +158,7 @@ class BirthdayService {
* @return array|null * @return array|null
* @throws \Sabre\DAV\Exception\BadRequest * @throws \Sabre\DAV\Exception\BadRequest
*/ */
public function ensureCalendarExists($principal) { public function ensureCalendarExists(string $principal):?array {
$calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
if (!is_null($calendar)) { if (!is_null($calendar)) {
return $calendar; return $calendar;
@ -151,14 +173,15 @@ class BirthdayService {
} }
/** /**
* @param string $cardData * @param $cardData
* @param string $dateField * @param $dateField
* @param string $postfix * @param $postfix
* @param string $summarySymbol * @return VCalendar|null
* @param string $utfSummarySymbol * @throws InvalidDataException
* @return null|VCalendar
*/ */
public function buildDateFromContact($cardData, $dateField, $postfix, $summarySymbol, $utfSummarySymbol) { public function buildDateFromContact(string $cardData,
string $dateField,
string $postfix):?VCalendar {
if (empty($cardData)) { if (empty($cardData)) {
return null; return null;
} }
@ -224,19 +247,8 @@ class BirthdayService {
} catch (Exception $e) { } catch (Exception $e) {
return null; return null;
} }
if ($this->dbConnection->supports4ByteText()) {
if ($unknownYear) { $summary = $this->formatTitle($dateField, $doc->FN->getValue(), $originalYear, $this->dbConnection->supports4ByteText());
$summary = $utfSummarySymbol . ' ' . $doc->FN->getValue();
} else {
$summary = $utfSummarySymbol . ' ' . $doc->FN->getValue() . " ($originalYear)";
}
} else {
if ($unknownYear) {
$summary = $doc->FN->getValue() . ' ' . $summarySymbol;
} else {
$summary = $doc->FN->getValue() . " ($summarySymbol$originalYear)";
}
}
$vCal = new VCalendar(); $vCal = new VCalendar();
$vCal->VERSION = '2.0'; $vCal->VERSION = '2.0';
@ -273,7 +285,7 @@ class BirthdayService {
/** /**
* @param string $user * @param string $user
*/ */
public function resetForUser($user) { public function resetForUser(string $user):void {
$principal = 'principals/users/'.$user; $principal = 'principals/users/'.$user;
$calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI); $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
$calendarObjects = $this->calDavBackEnd->getCalendarObjects($calendar['id'], CalDavBackend::CALENDAR_TYPE_CALENDAR); $calendarObjects = $this->calDavBackEnd->getCalendarObjects($calendar['id'], CalDavBackend::CALENDAR_TYPE_CALENDAR);
@ -285,8 +297,9 @@ class BirthdayService {
/** /**
* @param string $user * @param string $user
* @throws \Sabre\DAV\Exception\BadRequest
*/ */
public function syncUser($user) { public function syncUser(string $user):void {
$principal = 'principals/users/'.$user; $principal = 'principals/users/'.$user;
$this->ensureCalendarExists($principal); $this->ensureCalendarExists($principal);
$books = $this->cardDavBackEnd->getAddressBooksForUser($principal); $books = $this->cardDavBackEnd->getAddressBooksForUser($principal);
@ -303,25 +316,25 @@ class BirthdayService {
* @param VCalendar $newCalendarData * @param VCalendar $newCalendarData
* @return bool * @return bool
*/ */
public function birthdayEvenChanged($existingCalendarData, $newCalendarData) { public function birthdayEvenChanged(string $existingCalendarData,
VCalendar $newCalendarData):bool {
try { try {
$existingBirthday = Reader::read($existingCalendarData); $existingBirthday = Reader::read($existingCalendarData);
} catch (Exception $ex) { } catch (Exception $ex) {
return true; return true;
} }
if ($newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() ||
return (
$newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() ||
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue() $newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue()
) { );
return true;
}
return false;
} }
/** /**
* @param integer $addressBookId * @param integer $addressBookId
* @return mixed * @return mixed
*/ */
protected function getAllAffectedPrincipals($addressBookId) { protected function getAllAffectedPrincipals(int $addressBookId) {
$targetPrincipals = []; $targetPrincipals = [];
$shares = $this->cardDavBackEnd->getShares($addressBookId); $shares = $this->cardDavBackEnd->getShares($addressBookId);
foreach ($shares as $share) { foreach ($shares as $share) {
@ -339,14 +352,20 @@ class BirthdayService {
/** /**
* @param string $cardUri * @param string $cardUri
* @param string $cardData * @param string $cardData
* @param array $book * @param array $book
* @param int $calendarId * @param int $calendarId
* @param string[] $type * @param array $type
* @throws InvalidDataException
* @throws \Sabre\DAV\Exception\BadRequest
*/ */
private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) { private function updateCalendar(string $cardUri,
string $cardData,
array $book,
int $calendarId,
array $type):void {
$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics'; $objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
$calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix'], $type['symbol'], $type['utfSymbol']); $calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['postfix']);
$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri); $existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
if (is_null($calendarData)) { if (is_null($calendarData)) {
if (!is_null($existing)) { if (!is_null($existing)) {
@ -368,18 +387,17 @@ class BirthdayService {
* *
* @return bool * @return bool
*/ */
private function isGloballyEnabled() { private function isGloballyEnabled():bool {
$isGloballyEnabled = $this->config->getAppValue('dav', 'generateBirthdayCalendar', 'yes'); return $this->config->getAppValue('dav', 'generateBirthdayCalendar', 'yes') === 'yes';
return $isGloballyEnabled === 'yes';
} }
/** /**
* checks if the user opted-out of birthday calendars * Checks if the user opted-out of birthday calendars
* *
* @param $userPrincipal * @param string $userPrincipal The user principal to check for
* @return bool * @return bool
*/ */
private function isUserEnabled($userPrincipal) { private function isUserEnabled(string $userPrincipal):bool {
if (strpos($userPrincipal, 'principals/users/') === 0) { if (strpos($userPrincipal, 'principals/users/') === 0) {
$userId = substr($userPrincipal, 17); $userId = substr($userPrincipal, 17);
$isEnabled = $this->config->getUserValue($userId, 'dav', 'generateBirthdayCalendar', 'yes'); $isEnabled = $this->config->getUserValue($userId, 'dav', 'generateBirthdayCalendar', 'yes');
@ -390,4 +408,69 @@ class BirthdayService {
return true; return true;
} }
/**
* Formats title of Birthday event
*
* @param string $field Field name like BDAY, ANNIVERSARY, ...
* @param string $name Name of contact
* @param int|null $year Year of birth, anniversary, ...
* @param bool $supports4Byte Whether or not the database supports 4 byte chars
* @return string The formatted title
*/
private function formatTitle(string $field,
string $name,
int $year=null,
bool $supports4Byte=true):string {
if ($supports4Byte) {
switch ($field) {
case 'BDAY':
return implode('', [
'🎂 ',
$name,
$year ? (' (' . $year . ')') : '',
]);
case 'DEATHDATE':
return implode('', [
$this->l10n->t('Death of %s', [$name]),
$year ? (' (' . $year . ')') : '',
]);
case 'ANNIVERSARY':
return implode('', [
'💍 ',
$name,
$year ? (' (' . $year . ')') : '',
]);
default:
return '';
}
} else {
switch($field) {
case 'BDAY':
return implode('', [
$name,
' ',
$year ? ('(*' . $year . ')') : '*',
]);
case 'DEATHDATE':
return implode('', [
$this->l10n->t('Death of %s', [$name]),
$year ? (' (' . $year . ')') : '',
]);
case 'ANNIVERSARY':
return implode('', [
$name,
' ',
$year ? ('(⚭' . $year . ')') : '⚭',
]);
default:
return '';
}
}
}
} }

View File

@ -30,6 +30,7 @@ use OCA\DAV\CardDAV\CardDavBackend;
use OCA\DAV\DAV\GroupPrincipalBackend; use OCA\DAV\DAV\GroupPrincipalBackend;
use OCP\IConfig; use OCP\IConfig;
use OCP\IDBConnection; use OCP\IDBConnection;
use OCP\IL10N;
use Sabre\VObject\Component\VCalendar; use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Reader; use Sabre\VObject\Reader;
use Test\TestCase; use Test\TestCase;
@ -48,6 +49,8 @@ class BirthdayServiceTest extends TestCase {
private $config; private $config;
/** @var IDBConnection | \PHPUnit_Framework_MockObject_MockObject */ /** @var IDBConnection | \PHPUnit_Framework_MockObject_MockObject */
private $dbConnection; private $dbConnection;
/** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
private $l10n;
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
@ -57,9 +60,17 @@ class BirthdayServiceTest extends TestCase {
$this->groupPrincipalBackend = $this->createMock(GroupPrincipalBackend::class); $this->groupPrincipalBackend = $this->createMock(GroupPrincipalBackend::class);
$this->config = $this->createMock(IConfig::class); $this->config = $this->createMock(IConfig::class);
$this->dbConnection = $this->createMock(IDBConnection::class); $this->dbConnection = $this->createMock(IDBConnection::class);
$this->l10n = $this->createMock(IL10N::class);
$this->service = new BirthdayService($this->calDav, $this->cardDav, $this->l10n->expects($this->any())
$this->groupPrincipalBackend, $this->config, $this->dbConnection); ->method('t')
->willReturnCallback(function($string, $args) {
return vsprintf($string, $args);
});
$this->service = new BirthdayService($this->calDav,$this->cardDav,
$this->groupPrincipalBackend, $this->config,
$this->dbConnection, $this->l10n);
} }
/** /**
@ -71,9 +82,9 @@ class BirthdayServiceTest extends TestCase {
* @param string $expectedOriginalYear * @param string $expectedOriginalYear
* @param string | null $data * @param string | null $data
*/ */
public function testBuildBirthdayFromContact($expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $supports4Bytes) { public function testBuildBirthdayFromContact($expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $fieldType, $prefix, $supports4Bytes) {
$this->dbConnection->method('supports4ByteText')->willReturn($supports4Bytes); $this->dbConnection->method('supports4ByteText')->willReturn($supports4Bytes);
$cal = $this->service->buildDateFromContact($data, 'BDAY', '', '*', '🎂'); $cal = $this->service->buildDateFromContact($data, $fieldType, $prefix);
if ($expectedSummary === null) { if ($expectedSummary === null) {
$this->assertNull($cal); $this->assertNull($cal);
@ -169,7 +180,7 @@ class BirthdayServiceTest extends TestCase {
$service = $this->getMockBuilder(BirthdayService::class) $service = $this->getMockBuilder(BirthdayService::class)
->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection]) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
->getMock(); ->getMock();
$service->onCardChanged(666, 'gump.vcf', ''); $service->onCardChanged(666, 'gump.vcf', '');
@ -198,7 +209,7 @@ class BirthdayServiceTest extends TestCase {
/** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */ /** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
$service = $this->getMockBuilder(BirthdayService::class) $service = $this->getMockBuilder(BirthdayService::class)
->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection]) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
->getMock(); ->getMock();
$service->onCardChanged(666, 'gump.vcf', ''); $service->onCardChanged(666, 'gump.vcf', '');
@ -234,7 +245,7 @@ class BirthdayServiceTest extends TestCase {
/** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */ /** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
$service = $this->getMockBuilder(BirthdayService::class) $service = $this->getMockBuilder(BirthdayService::class)
->setMethods(['buildDateFromContact', 'birthdayEvenChanged']) ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection]) ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
->getMock(); ->getMock();
if ($expectedOp === 'delete') { if ($expectedOp === 'delete') {
@ -382,27 +393,29 @@ class BirthdayServiceTest extends TestCase {
public function providesVCards() { public function providesVCards() {
return [ return [
// $expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $supports4Byte // $expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $fieldType, $prefix, $supports4Byte
[null, null, null, null, null, null, true], [null, null, null, null, null, 'yasfewf', '', '', true],
[null, null, null, null, null, '', true], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n", 'BDAY', '', true],
[null, null, null, null, null, 'yasfewf', true], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:\r\nEND:VCARD\r\n", 'BDAY', '', true],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n", true], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:someday\r\nEND:VCARD\r\n", 'BDAY', '', true],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:\r\nEND:VCARD\r\n", true], ['🎂 12345 (1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", 'BDAY', '', true],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:someday\r\nEND:VCARD\r\n", true], ['🎂 12345 (1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", 'BDAY', '', true],
['🎂 12345 (1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", true], ['Death of 12345 (1900)', '19701231', 'DEATHDATE', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nDEATHDATE:19001231\r\nEND:VCARD\r\n", 'DEATHDATE', '-death', true],
['🎂 12345 (1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", true], ['Death of 12345 (1900)', '19701231', 'DEATHDATE', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nDEATHDATE:19001231\r\nEND:VCARD\r\n", 'DEATHDATE', '-death', false],
['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", true], ['💍 12345 (1900)', '19701231', 'ANNIVERSARY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nANNIVERSARY:19001231\r\nEND:VCARD\r\n", 'ANNIVERSARY', '-anniversary', true],
['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", true], ['12345 (⚭1900)', '19701231', 'ANNIVERSARY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nANNIVERSARY:19001231\r\nEND:VCARD\r\n", 'ANNIVERSARY', '-anniversary', false],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", true], ['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", 'BDAY', '', true],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", true], ['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", 'BDAY', '', true],
['🎂 12345 (900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", true], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", 'BDAY', '', true],
['12345 (*1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", false], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", 'BDAY', '', true],
['12345 (*1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", false], ['🎂 12345 (900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", 'BDAY', '', true],
['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", false], ['12345 (*1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", 'BDAY', '', false],
['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", false], ['12345 (*1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", 'BDAY', '', false],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", false], ['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", 'BDAY', '', false],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", false], ['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", 'BDAY', '', false],
['12345 (*900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", false], [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", 'BDAY', '', false],
[null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", 'BDAY', '', false],
['12345 (*900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", 'BDAY', '', false],
]; ];
} }
} }