Date.php 755 B

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