Skip to content

How do I prevent DTEND being day+1 #255

Answered by markuspoerschke
noeldum asked this question in Q&A
Discussion options

You must be logged in to vote

I assume, that you want to create a single day event that takes place on December 24th 2012.

The same behaviour can be examined when using the example1.php.

I created the following iCalendar file using the following code:

$vEvent = new \Eluceo\iCal\Component\Event();
$vEvent->setDtStart(new \DateTime('2020-12-24'));
$vEvent->setDtEnd(new \DateTime('2020-12-24'));
$vEvent->setNoTime(true);
$vEvent->setSummary('Christmas');

$vCalendar = new \Eluceo\iCal\Component\Calendar('www.example.com');
$vCalendar->addComponent($vEvent);

echo $vCalendar->render();

The output will contain the following lines:

DTSTART;VALUE=DATE:20201224
DTEND;VALUE=DATE:20201225

At first glance, it looks like an event…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by markuspoerschke
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #160 on April 25, 2021 11:01.