From f1c07977809ce3221286d53e99f0d91145b1166f Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 25 Apr 2019 11:24:09 +0200 Subject: Revert "update composer libs" This reverts commit e779335d060b3a51d6a144d23af4097ae6801473 --- .../sabre/vobject/lib/Property/VCard/TimeStamp.php | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php') diff --git a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php index fccf2d600..9d311f99d 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,9 +33,10 @@ class TimeStamp extends Text * * @return string */ - public function getValueType() - { + function getValueType() { + return 'TIMESTAMP'; + } /** @@ -45,16 +46,16 @@ class TimeStamp extends Text * * @return array */ - public function getJsonValue() - { + 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 @@ -63,19 +64,23 @@ 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 + * @param Xml\Writer $writer XML writer. + * + * @return void */ - 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()); + } } -- cgit v1.2.3