From a958c11a06ba2fd8c717aa4bf5b6be495e72ce8a Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Fri, 30 Dec 2016 13:27:28 +0100 Subject: relive: sort recorded talks chronologically --- model/Relive.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'model/Relive.php') diff --git a/model/Relive.php b/model/Relive.php index 3da7c90..b6d33da 100644 --- a/model/Relive.php +++ b/model/Relive.php @@ -52,8 +52,15 @@ class Relive return strcmp($a['room'], $b['room']); } - // all other talks get sorted by their name - return strcmp($a['title'], $b['title']); + // all other talks get sorted by their start time + // sorting the most recent talks to the top + $delta = $b['start'] - $a['start']; + + // sort by room in case of a collision + if($delta == 0) + return strcmp($a['room'], $b['room']); + else + return $delta; }); $talks_by_id = array(); -- cgit v1.2.3