Set DUE instead of DTSTART and DTEND
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
namespace OCA\Deck\Db;
|
namespace OCA\Deck\Db;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
use DateTimeZone;
|
||||||
use Sabre\VObject\Component\VCalendar;
|
use Sabre\VObject\Component\VCalendar;
|
||||||
|
|
||||||
class Card extends RelationalEntity {
|
class Card extends RelationalEntity {
|
||||||
@@ -124,10 +125,10 @@ class Card extends RelationalEntity {
|
|||||||
$event = $calendar->createComponent('VTODO');
|
$event = $calendar->createComponent('VTODO');
|
||||||
$event->UID = 'deck-card-' . $this->getId();
|
$event->UID = 'deck-card-' . $this->getId();
|
||||||
if ($this->getDuedate()) {
|
if ($this->getDuedate()) {
|
||||||
$event->DTSTAMP = new \DateTime();
|
$creationDate = new DateTime();
|
||||||
$event->DTSTART = new \DateTime($this->getDuedate());
|
$creationDate->setTimestamp($this->createdAt);
|
||||||
$event->DTEND = new \DateTime($this->getDuedate());
|
$event->DTSTAMP = $creationDate;
|
||||||
$event->DURATION = "PT1H";
|
$event->DUE = new DateTime($this->getDuedate(true), new DateTimeZone('UTC'));
|
||||||
}
|
}
|
||||||
$event->add('RELATED-TO', 'deck-stack-' . $this->getStackId());
|
$event->add('RELATED-TO', 'deck-stack-' . $this->getStackId());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user