Skip to content

Commit

Permalink
Set DUE instead of DTSTART and DTEND
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Sep 15, 2020
1 parent 19cdd31 commit e460879
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Db/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
namespace OCA\Deck\Db;

use DateTime;
use DateTimeZone;
use Sabre\VObject\Component\VCalendar;

class Card extends RelationalEntity {
Expand Down Expand Up @@ -124,10 +125,10 @@ public function getCalendarObject(): VCalendar {
$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());

Expand Down

0 comments on commit e460879

Please sign in to comment.