Fix VTODO and issues during rebase

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-06-14 14:49:46 +02:00
parent a67a80f6a7
commit f4201392f6

View File

@@ -123,9 +123,12 @@ class Card extends RelationalEntity {
$calendar = new VCalendar();
$event = $calendar->createComponent('VTODO');
$event->UID = 'deck-card-' . $this->getId();
$event->DTSTAMP = new \DateTime($this->getDuedate());
if ($this->getDuedate()) {
$event->DTSTAMP = new \DateTime();
$event->DTSTART = new \DateTime($this->getDuedate());
$event->DTEND = new \DateTime($this->getDuedate());
$event->DURATION = "PT1H";
}
$event->add('RELATED-TO', 'deck-stack-' . $this->getStackId());
// FIXME: For write support: CANCELLED / IN-PROCESS handling
@@ -134,6 +137,7 @@ class Card extends RelationalEntity {
$date = new DateTime();
$date->setTimestamp($this->getLastModified());
$event->COMPLETED = $date;
//$event->add('PERCENT-COMPLETE', 100);
}
if (count($this->getLabels()) > 0) {
$event->CATEGORIES = array_map(function ($label) {