diff options
author | Florian Larysch | 2016-12-30 13:27:28 +0100 |
---|---|---|
committer | Florian Larysch | 2016-12-30 13:31:55 +0100 |
commit | a958c11a06ba2fd8c717aa4bf5b6be495e72ce8a (patch) | |
tree | 8c6f307e1304476117287ab77ba0df8ae1753cb8 /model | |
parent | b454b2d26d9840dcd71ce65dbae21b0887fad536 (diff) |
relive: sort recorded talks chronologically
Diffstat (limited to 'model')
-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(); |