@@ -47,7 +47,7 @@ function Hallway (sites) {
47 const diff = (now - then)
47 const diff = (now - then)
48 const date = Math.floor(diff / 86400000)
48 const date = Math.floor(diff / 86400000)
50− return `<li class='entry'><span class='date'>${date}</span> <span class='author'>${entry.author}</span> <span class='body'>${entry.body}</span></li>`
50+ return `<li class='entry'><span class='date'>${ago(date)}</span> <span class='author'>${entry.author}</span> <span class='body'>${entry.body}</span></li>`
@@ -72,7 +72,7 @@ function Hallway (sites) {
73 this.fetchFeed = function (id, feed) {
73 this.fetchFeed = function (id, feed) {
74 console.log(`Fetching ${id}(${feed.path})..`)
74 console.log(`Fetching ${id}(${feed.path})..`)
75− Promise.all([ fetch(feed.path).then(x => x.text()) ]).then(([content]) => {
75+ Promise.all([ fetch(feed.path, { cache: 'no-store' }).then(x => x.text()) ]).then(([content]) => {
76 feeds[id].content = parseFeed(id, content)
76 feeds[id].content = parseFeed(id, content)
77 this.refresh()
77 this.refresh()
@@ -97,4 +97,14 @@ function Hallway (sites) {
98 return entries
98 return entries
101+ function ago (days, cap = 9999) {
102+ if (-days > cap) { return `${this.toString(true)}` }
103+ if (days === -1) { return `yesterday` }
104+ if (days === 1) { return 'tomorrow' }
105+ if (days === 0) { return 'today' }
106+ if (days < -365) { return `${Math.floor(days / -365)} years ago` }
107+ if (days < 1) { return `${days * -1} days ago` }
108+ return `in ${days} days`