Use a birthday title which does not require translation because we have no idea about the target device language and forcing English upon all users is kind of bad

This commit is contained in:
Thomas Müller 2016-03-10 12:41:37 +01:00
parent 51072f742e
commit fe7103506b
2 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ class BirthdayService {
}
$title = str_replace('{name}',
strtr((string)$doc->FN, array('\,' => ',', '\;' => ';')),
'{name}\'s Birthday'
'{name}'
);
try {
$date = new \DateTime($birthday);
@ -146,7 +146,7 @@ class BirthdayService {
$vEvent->DTEND['VALUE'] = 'DATE';
$vEvent->{'UID'} = $doc->UID;
$vEvent->{'RRULE'} = 'FREQ=YEARLY';
$vEvent->{'SUMMARY'} = $title . ' (' . $date->format('Y') . ')';
$vEvent->{'SUMMARY'} = $title . ' (*' . $date->format('Y') . ')';
$vEvent->{'TRANSP'} = 'TRANSPARENT';
$vCal->add($vEvent);
return $vCal;

View File

@ -59,7 +59,7 @@ class BirthdayServiceTest extends TestCase {
$this->assertInstanceOf('Sabre\VObject\Component\VCalendar', $cal);
$this->assertTrue(isset($cal->VEVENT));
$this->assertEquals('FREQ=YEARLY', $cal->VEVENT->RRULE->getValue());
$this->assertEquals('12345\'s Birthday (1900)', $cal->VEVENT->SUMMARY->getValue());
$this->assertEquals('12345 (*1900)', $cal->VEVENT->SUMMARY->getValue());
$this->assertEquals('TRANSPARENT', $cal->VEVENT->TRANSP->getValue());
}
}