51 parent::setParts($parts);
71 } elseif (
$value instanceof DateTimeInterface) {
91 $this->
setValue(explode($this->delimiter, $val));
102 return implode($this->delimiter, $this->
getParts());
113 return strtoupper((
string)$this[
'VALUE']) !==
'DATE';
127 !isset($this[
'TZID']) &&
128 strpos($this->
getValue(),
'Z') === false
172 $tzid = $this[
'TZID'];
179 foreach ($this->
getParts() as $part) {
220 foreach ($dt as
$d) {
223 $values[] = $d->format(
'Ymd\\THis');
227 $tz = $d->getTimeZone();
228 $isUtc = in_array(
$tz->getName(), [
'UTC',
'GMT',
'Z',
'+00:00']);
233 $d = $d->setTimeZone(
$tz);
237 $values[] = $d->format(
'Ymd\\THis\\Z');
239 $values[] = $d->format(
'Ymd\\THis');
243 if ($isUtc || $isFloating) {
249 foreach ($dt as
$d) {
272 return $this->
hasTime() ?
'DATE-TIME' :
'DATE';
289 $tz = $dts[0]->getTimeZone();
290 $isUtc = $isFloating ? false : in_array(
$tz->getName(), [
'UTC',
'GMT',
'Z']);
296 return $dt->format(
'Y-m-d\\TH:i:s') . ($isUtc ?
'Z' :
'');
298 return $dt->format(
'Y-m-d');
326 return strtr($item, [
':' =>
'',
'-' =>
'']);
347 if (strtoupper(
$name) !==
'VALUE') {
385 switch ($valueType) {
397 'message' =>
'The supplied value (' .
$value .
') is not a correct ' . $valueType,
static parse($date, $referenceTz=null)
Parses either a Date or DateTime, or Duration value.
isFloating()
Returns true if this is a floating DATE or DATE-TIME.
setDateTime(DateTimeInterface $dt, $isFloating=false)
Sets the property as a DateTime object.
static parseDateTime($dt, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted datetime and returns a DateTimeImmutable object.
static static getTimeZone($tzid, Component $vcalendar=null, $failIfUncertain=false)
This method will try to find out the correct timezone for an iCalendar date-time value.
validate($options=0)
Validates the node for correctness.
setValue($value)
Updates the current value.
setDateTimes(array $dt, $isFloating=false)
Sets the property as multiple date-time objects.
getParts()
Returns a multi-valued property.
setParts(array $parts)
Sets a multi-valued property.
setRawMimeDirValue($val)
Sets a raw value coming from a mimedir (iCalendar/vCard) file.
getDateTimes(DateTimeZone $timeZone=null)
Returns multiple date-time values.
getDateTime(DateTimeZone $timeZone=null)
Returns a date-time value.
static parseDate($date, DateTimeZone $tz=null)
Parses an iCalendar (rfc5545) formatted date and returns a DateTimeImmutable object.
offsetUnset($name)
Removes one or more parameters with the specified name.
getValueType()
Returns the type of value.
getJsonValue()
Returns the value, in the format it should be encoded for JSON.
getValue()
Returns the current value.
offsetSet($name, $value)
We need to intercept offsetSet, because it may be used to alter the VALUE from DATE-TIME to DATE or v...
getRawMimeDirValue()
Returns a raw mime-dir representation of the value.
hasTime()
Returns true if this is a DATE-TIME value, false if it's a DATE.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
setJsonValue(array $value)
Sets the json value, as it would appear in a jCard or jCal object.
This exception is thrown whenever an invalid value is found anywhere in a iCalendar or vCard object...