@@ -36,7 +36,7 @@ function Hallway (sites) {
36 a.push(entry)
36 a.push(entry)
39− return a.sort(compare).reverse()
39+ return a.sort(compare)
42 this.templateEntry = function (entry) {
42 this.templateEntry = function (entry) {
@@ -89,7 +89,7 @@ function Hallway (sites) {
91 function compare (a, b) {
91 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
95 function parseFeed (author, feed) {
95 function parseFeed (author, feed) {
@@ -101,16 +101,13 @@ function Hallway (sites) {
101 const parts = line.replace(' ', '\t').split('\t')
101 const parts = line.replace(' ', '\t').split('\t')
102 const date = parts[0].trim()
102 const date = parts[0].trim()
103 const body = parts[1].trim()
103 const body = parts[1].trim()
104+ const offset = new Date() - new Date(date)
104− entries.push({ date, body, author })
105+ entries.push({ date, body, author, offset })
106 return entries
107 return entries
109 function timeAgo (dateParam) {
110 function timeAgo (dateParam) {
114 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
111 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
115 const DAY_IN_MS = 86400000 // 24 * 60 * 60 * 1000
112 const DAY_IN_MS = 86400000 // 24 * 60 * 60 * 1000
116 const today = new Date()
113 const today = new Date()