17 $prop = $vcard->createProperty(
'BDAY',
$input);
19 $this->assertEquals([
$output], $prop->getJsonValue());
28 "1996-10-22T14:00:00",
90 $prop = $vcard->createProperty(
'BDAY');
95 $this->assertEquals(
'20140402T183700Z', $prop->getValue());
103 $prop = $vcard->createProperty(
'BDAY');
108 $this->assertEquals(
'20140402T183700Z', $prop->getValue());
119 $prop = $vcard->createProperty(
'BDAY');
131 $prop = $vcard->createProperty(
'BDAY');
136 $this->assertEquals(
'20140402T183700Z', $prop->getValue());
144 $prop = $vcard->createProperty(
'BDAY');
146 new \
DateTime(
'2014-04-02 18:37:00')
149 $this->assertEquals(
'20140402T183700Z', $prop->getValue());
157 $prop = $vcard->createProperty(
'BDAY');
162 $this->assertEquals(
'20140402T183700Z', $prop->getValue());
170 $prop = $vcard->createProperty(
'BDAY');
175 $this->assertEquals(
'20140402T183700-0400', $prop->getValue());
181 $datetime = new \DateTime(
'2014-04-02 18:37:00',
new \
DateTimeZone(
'America/Toronto'));
184 $prop = $vcard->createProperty(
'BDAY', $datetime);
186 $dt = $prop->getDateTime();
187 $this->assertEquals(
'2014-04-02T18:37:00-04:00', $dt->format(
'c'),
"For some reason this one failed. Current default timezone is: " . date_default_timezone_get());
193 $datetime = new \DateTime(
'2014-04-02');
196 $prop = $vcard->createProperty(
'BDAY', $datetime, null,
'DATE');
198 $this->assertEquals(
'DATE', $prop->getValueType());
199 $this->assertEquals(
'BDAY:20140402', rtrim($prop->serialize()));
205 $datetime =
'--0407';
208 $prop = $vcard->add(
'BDAY', $datetime);
210 $dt = $prop->getDateTime();
218 $this->assertEquals($year .
'0407', $dt->format(
'Ymd'));
231 $prop = $vcard->BDAY;
233 $dt = $prop->getDateTime();
241 $this->assertEquals($year .
'0407', $dt->format(
'Ymd'));
247 $datetime =
'--0407';
250 $prop = $vcard->add(
'BDAY', $datetime);
252 $this->assertEquals([], $prop->validate());
261 $prop = $vcard->add(
'BDAY', $datetime);
263 $this->assertEquals([[
265 'message' =>
'The supplied value (123) is not a correct DATE-AND-OR-TIME property',
267 ]], $prop->validate());
testSetValueDateTimeImmutable()
testGetDateIncompleteFromVCard()
testSetPartsTooMany()
InvalidArgumentException
testSetPartsDateTimeImmutable()
static read($data, $options=0, $charset='UTF-8')
Parses a vCard or iCalendar object, and returns the top component.
testGetJsonValue($input, $output)
dates