12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace Sabre\VObject\Property;
- use Sabre\VObject\DateTimeParser;
- class Time extends Text {
-
- public $delimiter = null;
-
- public function getValueType() {
- return "TIME";
- }
-
- public function getJsonValue() {
- $parts = DateTimeParser::parseVCardTime($this->getValue());
- $timeStr = '';
-
- if (!is_null($parts['hour'])) {
- $timeStr.=$parts['hour'];
- if (!is_null($parts['minute'])) {
- $timeStr.=':';
- }
- } else {
-
-
- $timeStr.='-';
- }
-
- if (!is_null($parts['minute'])) {
- $timeStr.=$parts['minute'];
- if (!is_null($parts['second'])) {
- $timeStr.=':';
- }
- } else {
- if (isset($parts['second'])) {
-
- $timeStr.='-';
- }
- }
-
- if (!is_null($parts['second'])) {
- $timeStr.=$parts['second'];
- }
-
- if (!is_null($parts['timezone'])) {
- $timeStr.=$parts['timezone'];
- }
- return array($timeStr);
- }
- }
|