Merge pull request #9 from netlify/fix_plural

Show `1 day since` when there was an incident yesterday.
This commit is contained in:
David Calavera 2016-11-21 17:52:01 -08:00 committed by GitHub
commit 3c2bec093a

View File

@ -8,6 +8,6 @@ if (daysSince) {
const timeSince = new Date() - new Date(dateSince);
const endDays = Math.floor(timeSince / aDay);
console.log(endDays);
daysSince.innerHTML = `${endDays} days since last incident`
const count = endDays == 1 ? `${endDays} day` : `${endDays} days`;
daysSince.innerHTML = `${count} since last incident`;
}