Set DUE instead of DTSTART and DTEND

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-09-15 10:27:42 +02:00
parent 19cdd31c40
commit e460879f41

View File

@@ -24,6 +24,7 @@
namespace OCA\Deck\Db;
use DateTime;
use DateTimeZone;
use Sabre\VObject\Component\VCalendar;
class Card extends RelationalEntity {
@@ -124,10 +125,10 @@ class Card extends RelationalEntity {
$event = $calendar->createComponent('VTODO');
$event->UID = 'deck-card-' . $this->getId();
if ($this->getDuedate()) {
$event->DTSTAMP = new \DateTime();
$event->DTSTART = new \DateTime($this->getDuedate());
$event->DTEND = new \DateTime($this->getDuedate());
$event->DURATION = "PT1H";
$creationDate = new DateTime();
$creationDate->setTimestamp($this->createdAt);
$event->DTSTAMP = $creationDate;
$event->DUE = new DateTime($this->getDuedate(true), new DateTimeZone('UTC'));
}
$event->add('RELATED-TO', 'deck-stack-' . $this->getStackId());