diff options
Diffstat (limited to 'vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php')
-rw-r--r-- | vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php index 9d311f99d..fccf2d600 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php +++ b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php @@ -15,8 +15,8 @@ use Sabre\Xml; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class TimeStamp extends Text { - +class TimeStamp extends Text +{ /** * In case this is a multi-value property. This string will be used as a * delimiter. @@ -33,10 +33,9 @@ class TimeStamp extends Text { * * @return string */ - function getValueType() { - + public function getValueType() + { return 'TIMESTAMP'; - } /** @@ -46,16 +45,16 @@ class TimeStamp extends Text { * * @return array */ - function getJsonValue() { - + public function getJsonValue() + { $parts = DateTimeParser::parseVCardDateTime($this->getValue()); $dateStr = - $parts['year'] . '-' . - $parts['month'] . '-' . - $parts['date'] . 'T' . - $parts['hour'] . ':' . - $parts['minute'] . ':' . + $parts['year'].'-'. + $parts['month'].'-'. + $parts['date'].'T'. + $parts['hour'].':'. + $parts['minute'].':'. $parts['second']; // Timezone @@ -64,23 +63,19 @@ class TimeStamp extends Text { } return [$dateStr]; - } /** * This method serializes only the value of a property. This is used to * create xCard or xCal documents. * - * @param Xml\Writer $writer XML writer. - * - * @return void + * @param Xml\Writer $writer XML writer */ - protected function xmlSerializeValue(Xml\Writer $writer) { - + protected function xmlSerializeValue(Xml\Writer $writer) + { // xCard is the only XML and JSON format that has the same date and time // format than vCard. $valueType = strtolower($this->getValueType()); $writer->writeElement($valueType, $this->getValue()); - } } |