Add Temporal::MYSQL constant

This commit is contained in:
Hypolite Petovan 2018-01-25 22:00:29 -05:00
parent b24690e8df
commit 6d23de1bdb
8 changed files with 24 additions and 20 deletions

View file

@ -1,6 +1,7 @@
<?php
use Friendica\Core\L10n;
use Friendica\Util\Temporal;
/**
* @param wdcal_local $localization
@ -520,9 +521,9 @@ function wdcal_set_component_date(&$component, &$localization)
$type = Sabre\VObject\Property\DateTime::LOCALTZ;
}
$datetime_start = new Sabre\VObject\Property\DateTime("DTSTART");
$datetime_start->setDateTime(new DateTime(date("Y-m-d H:i:s", $ts_start)), $type);
$datetime_start->setDateTime(new DateTime(date(Temporal::MYSQL, $ts_start)), $type);
$datetime_end = new Sabre\VObject\Property\DateTime("DTEND");
$datetime_end->setDateTime(new DateTime(date("Y-m-d H:i:s", $ts_end)), $type);
$datetime_end->setDateTime(new DateTime(date(Temporal::MYSQL, $ts_end)), $type);
$component->__unset("DTSTART");
$component->__unset("DTEND");
@ -598,7 +599,7 @@ function wdcal_set_component_recurrence(&$component, &$localization)
$date = $localization->date_local2timestamp($_REQUEST["rec_until_date"]);
$part_until = ";UNTIL=" . date("Ymd", $date);
$datetime_until = new Sabre\VObject\Property\DateTime("UNTIL");
$datetime_until->setDateTime(new DateTime(date("Y-m-d H:i:s", $date)), Sabre\VObject\Property\DateTime::DATE);
$datetime_until->setDateTime(new DateTime(date(Temporal::MYSQL, $date)), Sabre\VObject\Property\DateTime::DATE);
break;
case "count":
$part_until = ";COUNT=" . IntVal($_REQUEST["rec_until_count"]);
@ -645,7 +646,7 @@ function wdcal_set_component_recurrence(&$component, &$localization)
if (isset($_REQUEST["rec_exceptions"])) {
$arr = array();
foreach ($_REQUEST["rec_exceptions"] as $except) {
$arr[] = new DateTime(date("Y-m-d H:i:s", $except));
$arr[] = new DateTime(date(Temporal::MYSQL, $except));
}
/** @var Sabre\VObject\Property\MultiDateTime $prop */
$prop = Sabre\VObject\Property::create("EXDATE");