]> git.mxchange.org Git - friendica-addons.git/blobdiff - dav/common/calendar_rendering.fnk.php
Merge branch '3.6-rc'
[friendica-addons.git] / dav / common / calendar_rendering.fnk.php
index d80892f7ccac8d630a3c506945c2e3cddbe960f6..bc13ce39fe7250b6e2cc68932cf57d68ed1e5745 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use Friendica\Util\DateTimeFormat;
 
 
 /**
@@ -109,15 +110,15 @@ function renderCalDavEntry_data(&$calendar, &$calendarobject)
 
                q("INSERT INTO %s%sjqcalendar (`calendar_id`, `calendarobject_id`, `Summary`, `StartTime`, `EndTime`, `IsEditable`, `IsAllDayEvent`, `IsRecurring`, `Color`) VALUES
                        (%d, %d, '%s', CONVERT_TZ('%s', '$timezoneOffset', @@session.time_zone), CONVERT_TZ('%s', '$timezoneOffset', @@session.time_zone), %d, %d, %d, '%s')",
-                       CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendar["id"]), IntVal($calendarobject["id"]), dbesc($event["summary"]), date("Y-m-d H:i:s", $start),
-                       date("Y-m-d H:i:s", $last_end), 1, $allday, $recurring, dbesc(substr($event["color"], 1))
+                       CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendar["id"]), IntVal($calendarobject["id"]), dbesc($event["summary"]), date(DateTimeFormat::MYSQL, $start),
+                       date(DateTimeFormat::MYSQL, $last_end), 1, $allday, $recurring, dbesc(substr($event["color"], 1))
                );
 
                foreach ($alarms as $alarm) {
                        $alarm    = renderCalDavEntry_calcalarm($alarm, $component);
                        $notified = ($alarm->getTimestamp() < time() ? 1 : 0);
                        q("INSERT INTO %s%snotifications (`calendar_id`, `calendarobject_id`, `alert_date`, `notified`) VALUES (%d, %d, CONVERT_TZ('%s', '$timezoneOffset', @@session.time_zone), %d)",
-                               CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendar["id"]), IntVal($calendarobject["id"]), $alarm->format("Y-m-d H:i:s"), $notified
+                               CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($calendar["id"]), IntVal($calendarobject["id"]), $alarm->format(DateTimeFormat::MYSQL), $notified
                        );
                }