summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-05 13:44:20 +0100
committerSimon Rettberg2017-12-05 13:44:20 +0100
commit75e738b2351f91e36451261207abca53f0851ff0 (patch)
tree84a5f7af20e0084864596f0018e383819d6c4867 /modules-available/locationinfo/inc/coursebackend
parent[inc/Util] prettyTime: return '???' if given timestamp is 0 or not a number (diff)
downloadslx-admin-75e738b2351f91e36451261207abca53f0851ff0.tar.gz
slx-admin-75e738b2351f91e36451261207abca53f0851ff0.tar.xz
slx-admin-75e738b2351f91e36451261207abca53f0851ff0.zip
[locationinfo] Fix formatting of calendar starttime/endtime, remove if not possible
The weekcalendar plugin chokes on badly formatted timestamps, so either fix or remove dates which don't match the expectation. Fixes #3192
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
index e2577284..24e01070 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
@@ -87,13 +87,24 @@ class CourseBackend_Dummy extends CourseBackend
*
* @param $roomIds array with local ID as key and serverId as value
* @return array a recursive array that uses the roomID as key
- * and has the schedule array as value. A shedule array contains an array in this format:
- * ["start"=>'JJJJ-MM-DD HH:MM:SS',"end"=>'JJJJ-MM-DD HH:MM:SS',"title"=>string]
+ * and has the schedule array as value. A schedule array contains an array in this format:
+ * ["start"=>'YYYY-MM-DD<T>HH:MM:SS',"end"=>'YYYY-MM-DD<T>HH:MM:SS',"title"=>string]
*/
public function fetchSchedulesInternal($roomId)
{
$a = array();
foreach ($roomId as $id) {
+ if ($id == 1) {
+ $now = time();
+ return array($id => array(
+ array(
+ 'title' => 'Lange',
+ 'start' => date('Y-m-d', $now) . 'T0:00:00',
+ 'end' => date('Y-m-d', $now + 86400 * 3) . 'T0:00:00',
+ )
+ ));
+ }
+ // Normal
$x = array();
$time = strtotime('today');
$end = strtotime('+7 days', $time);