aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind2018-05-12 02:00:51 +0200
committerMaZderMind2018-05-12 02:02:24 +0200
commit91a653392c0e66f1941036e2b17d8fa6b162cde0 (patch)
treed1e6ceabe67aa4e3934c1e395a7c95636fd0524f
parent888bff1972e18a7f32d55fcc23cd4900d03c7d61 (diff)
migrate logic for calculating schedule display time into schedule class
Diffstat (limited to '')
-rw-r--r--model/Schedule.php9
-rw-r--r--view/overview.php2
2 files changed, 10 insertions, 1 deletions
diff --git a/model/Schedule.php b/model/Schedule.php
index ec4ddc7..4b5d25e 100644
--- a/model/Schedule.php
+++ b/model/Schedule.php
@@ -44,6 +44,15 @@ class Schedule
return $this->getConference()->getRoomIfExists( @$mapping[$scheduleRoom] );
}
+ public function getScheduleDisplayTime($basetime = null)
+ {
+ if(is_null($basetime)) {
+ $basetime = time();
+ }
+
+ return $basetime + $this->getSimulationOffset();
+ }
+
private function fetchSchedule()
{
$schedule = @file_get_contents($this->getScheduleCache());
diff --git a/view/overview.php b/view/overview.php
index e5032c4..fb9d15d 100644
--- a/view/overview.php
+++ b/view/overview.php
@@ -2,7 +2,7 @@
$schedule = $conference->getSchedule();
-$now = time() + $schedule->getSimulationOffset();
+$now = $schedule->getScheduleDisplayTime();
$upcomingTalksPerRoom = [];
foreach ($conference->getRooms() as $room) {
$upcomingTalksPerRoom[$room->getSlug()] = [