How do I prevent DTEND being day+1 #255
-
How do I prevent DTEND being day+1 in the output? I tried both in both cases I get instead of 20121224 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
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 that occurs on the 24th and 25th is created. Importing the iCalendar file into Windows' calendar app will show the following result: The event is created as a single day event on the 24th only. If we check the specification, we will see the reason:
In other words, the event will take place for the following interval:
This is why |
Beta Was this translation helpful? Give feedback.
-
Came here for the same thing, thanks for the explanation. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have the same problem, but with an event more than 1 day long. The end date is the day I sent to the $vEvent->setDtEnd function + 1 day. The resulting ICS file have the end date i want +1. When i add this ICS file to Google Calendar, it works well (with the end date I need), but with the same ICS file, when I use it on Abritel and Airbnb, it's the end date +1 day. How can I do for my ICS file to work with Abritel and Airbnb correctly ? Thank you for your help. Best regards |
Beta Was this translation helpful? Give feedback.
-
I cannot give support for special consumers of the resulting ics file. Maybe, if you provide an example PHP code and the resulting ICS file can help to see the problem. |
Beta Was this translation helpful? Give feedback.
-
Hi, Thank you for your reply... I managed to get my ICS file to work as expected by setting the beggining and ending hour, so my code changed since my original demand. Thank you again for trying to help me. Lionel |
Beta Was this translation helpful? Give feedback.
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:
The output will contain the following lines:
At first glance, it looks like an event…