ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
TimeStamp.php
Go to the documentation of this file.
1<?php
2
4
7use Sabre\Xml;
8
18class TimeStamp extends Text {
19
26 public $delimiter = null;
27
36 function getValueType() {
37
38 return 'TIMESTAMP';
39
40 }
41
49 function getJsonValue() {
50
52
53 $dateStr =
54 $parts['year'] . '-' .
55 $parts['month'] . '-' .
56 $parts['date'] . 'T' .
57 $parts['hour'] . ':' .
58 $parts['minute'] . ':' .
59 $parts['second'];
60
61 // Timezone
62 if (!is_null($parts['timezone'])) {
63 $dateStr .= $parts['timezone'];
64 }
65
66 return [$dateStr];
67
68 }
69
78 protected function xmlSerializeValue(Xml\Writer $writer) {
79
80 // xCard is the only XML and JSON format that has the same date and time
81 // format than vCard.
82 $valueType = strtolower($this->getValueType());
83 $writer->writeElement($valueType, $this->getValue());
84
85 }
86}
An exception for terminatinating execution or to throw for unit testing.
static parseVCardDateTime($date)
This method parses a vCard date and or time value.
Text property.
Definition: Text.php:20
xmlSerializeValue(Xml\Writer $writer)
This method serializes only the value of a property.
Definition: TimeStamp.php:78
getJsonValue()
Returns the value, in the format it should be encoded for json.
Definition: TimeStamp.php:49
getValueType()
Returns the type of value.
Definition: TimeStamp.php:36
getValue()
Returns the current value.
Definition: Property.php:115
iCalendar/vCard/jCal/jCard/xCal/xCard writer object.
Definition: Writer.php:17