diff options
Diffstat (limited to '')
-rw-r--r-- | model/Relive.php | 11 |
1 files changed, 9 insertions, 2 deletions
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(); |