@@ -36,7 +36,7 @@ function Hallway (sites) {
3636 a.push(entry)
3737 }
3838 }
39− return a.sort(compare).reverse()
39+ return a.sort(compare)
4040 }
4141
4242 this.templateEntry = function (entry) {
@@ -89,7 +89,7 @@ function Hallway (sites) {
8989 // Utils
9090
9191 function compare (a, b) {
92− return a.date < b.date ? -1 : a.date > b.date ? 1 : 0
92+ return a.offset < b.offset ? -1 : a.offset > b.offset ? 1 : 0
9393 }
9494
9595 function parseFeed (author, feed) {
@@ -101,16 +101,13 @@ function Hallway (sites) {
101101 const parts = line.replace(' ', '\t').split('\t')
102102 const date = parts[0].trim()
103103 const body = parts[1].trim()
104− entries.push({ date, body, author })
104+ const offset = new Date() - new Date(date)
105+ entries.push({ date, body, author, offset })
105106 }
106107 return entries
107108 }
108109
109110 function timeAgo (dateParam) {
110− if (!dateParam) {
111− return null
112− }
113−
114111 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
115112 const DAY_IN_MS = 86400000 // 24 * 60 * 60 * 1000
116113 const today = new Date()