From 32af067e1e48bd94d5aaff32d1254cde44567213 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Feb 2022 13:01:29 +0100 Subject: [PATCH] Code comment --- htdocs/core/lib/xcal.lib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 74b5f711da9..97ada3e3d4f 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -209,7 +209,10 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) // End date if ($fulldayevent) { if (empty($enddate)) { - $enddate = dol_time_plus_duree($startdate, 1, "d"); // We add 1 day needed for full day event (DTEND must be next day after event) + // We add 1 day needed for full day event (DTEND must be next day after event). + // This is mention in https://datatracker.ietf.org/doc/html/rfc5545: + // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event." + $enddate = dol_time_plus_duree($startdate, 1, "d"); } } else { if (empty($enddate)) { @@ -222,7 +225,10 @@ function build_calfile($format, $title, $desc, $events_array, $outputfile) if ($fulldayevent) { $prefix = ";VALUE=DATE"; - $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt'); // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event) + // We add 1 second so we reach the +1 day needed for full day event (DTEND must be next day after event) + // This is mention in https://datatracker.ietf.org/doc/html/rfc5545: + // "The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event." + $enddatef = dol_print_date($enddate + 1, "dayxcard", 'gmt'); } fwrite($calfileh, "DTEND".$prefix.":".$enddatef."\n");