Date.php 837 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Sabre\VObject\Property\VCard;
  3. use
  4. Sabre\VObject\DateTimeParser;
  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. * Returns the type of value.
  17. *
  18. * This corresponds to the VALUE= parameter. Every property also has a
  19. * 'default' valueType.
  20. *
  21. * @return string
  22. */
  23. public function getValueType() {
  24. return "DATE";
  25. }
  26. /**
  27. * Sets the property as a DateTime object.
  28. *
  29. * @param \DateTime $dt
  30. * @return void
  31. */
  32. public function setDateTime(\DateTime $dt) {
  33. $this->value = $dt->format('Ymd');
  34. }
  35. }