Date.php
1 year ago
DateAndOrTime.php
1 year ago
DateTime.php
1 year ago
LanguageTag.php
1 year ago
PhoneNumber.php
1 year ago
TimeStamp.php
1 year ago
Date.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Sabre\VObject\Property\VCard; |
| 4 | |
| 5 | /** |
| 6 | * Date property. |
| 7 | * |
| 8 | * This object encodes vCard DATE values. |
| 9 | * |
| 10 | * @copyright Copyright (C) fruux GmbH (https://fruux.com/) |
| 11 | * @author Evert Pot (http://evertpot.com/) |
| 12 | * @license http://sabre.io/license/ Modified BSD License |
| 13 | */ |
| 14 | class Date extends DateAndOrTime |
| 15 | { |
| 16 | /** |
| 17 | * Returns the type of value. |
| 18 | * |
| 19 | * This corresponds to the VALUE= parameter. Every property also has a |
| 20 | * 'default' valueType. |
| 21 | * |
| 22 | * @return string |
| 23 | */ |
| 24 | public function getValueType() |
| 25 | { |
| 26 | return 'DATE'; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Sets the property as a DateTime object. |
| 31 | */ |
| 32 | public function setDateTime(\DateTimeInterface $dt) |
| 33 | { |
| 34 | $this->value = $dt->format('Ymd'); |
| 35 | } |
| 36 | } |
| 37 |