summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-06-15 11:39:19 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-06-15 11:39:19 +0200
commit22a33b509ff8339393834764a19d8d026177783e (patch)
tree92f34af5cd1a3bdbd782b6877abf088d550f32f3
parente4529301ff2ff8f8b6cb668cd48243070dabebde (diff)
downloadnextcloud-server-22a33b509ff8339393834764a19d8d026177783e.tar.gz
nextcloud-server-22a33b509ff8339393834764a19d8d026177783e.zip
use DateTime as type of parameter in the functions is_cached_inperiod and get_inperiod
-rw-r--r--apps/calendar/lib/app.php4
-rw-r--r--apps/calendar/lib/repeat.php12
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/calendar/lib/app.php b/apps/calendar/lib/app.php
index 4adfa28dd19..4711bf7a2e3 100644
--- a/apps/calendar/lib/app.php
+++ b/apps/calendar/lib/app.php
@@ -378,8 +378,8 @@ class OC_Calendar_App{
'description' => isset($vevent->DESCRIPTION)?htmlspecialchars($vevent->DESCRIPTION->value):'',
'lastmodified'=>$lastmodified,
'allDay'=>$allday);
- if(OC_Calendar_Object::isrepeating($id) && OC_Calendar_Repeat::is_cached_inperiod($event['id'], OC_Calendar_Object::getUTCforMDB($start), OC_Calendar_Object::getUTCforMDB($end))){
- $cachedinperiod = OC_Calendar_Repeat::get_inperiod($id, OC_Calendar_Object::getUTCforMDB($start), OC_Calendar_Object::getUTCforMDB($end));
+ if(OC_Calendar_Object::isrepeating($id) && OC_Calendar_Repeat::is_cached_inperiod($event['id'], $start, $end)){
+ $cachedinperiod = OC_Calendar_Repeat::get_inperiod($id, $start, $end);
foreach($cachedinperiod as $cachedevent){
$dynamicoutput = array();
if($allday){
diff --git a/apps/calendar/lib/repeat.php b/apps/calendar/lib/repeat.php
index d1b14eea911..4b9cbdcd4ba 100644
--- a/apps/calendar/lib/repeat.php
+++ b/apps/calendar/lib/repeat.php
@@ -27,8 +27,8 @@ class OC_Calendar_Repeat{
/*
* @brief returns the cache of an event in a specific peroid
* @param (int) $id - id of the event
- * @param (string) $from - start for period in UTC
- * @param (string) $until - end for period in UTC
+ * @param (DateTime) $from - start for period in UTC
+ * @param (DateTime) $until - end for period in UTC
* @return (array)
*/
public static function get_inperiod($id, $from, $until){
@@ -36,8 +36,8 @@ class OC_Calendar_Repeat{
.' AND ((startdate >= ? AND startdate <= ?)'
.' OR (enddate >= ? AND enddate <= ?))');
$result = $stmt->execute(array($id,
- $from, $until,
- $from, $until));
+ OC_Calendar_Object::getUTCforMDB($from), OC_Calendar_Object::getUTCforMDB($until),
+ OC_Calendar_Object::getUTCforMDB($from), OC_Calendar_Object::getUTCforMDB($until)));
$return = array();
while($row = $result->fetchRow()){
$return[] = $row;
@@ -164,8 +164,8 @@ class OC_Calendar_Repeat{
/*
* @brief checks if an event is already cached in a specific period
* @param (int) id - id of the event
- * @param (string) $from - start for period in UTC
- * @param (string) $until - end for period in UTC
+ * @param (DateTime) $from - start for period in UTC
+ * @param (DateTime) $until - end for period in UTC
* @return (bool)
*/
public static function is_cached_inperiod($id, $start, $end){