Merge pull request #9 from netlify/fix_plural
Show `1 day since` when there was an incident yesterday.
This commit is contained in:
commit
3c2bec093a
@ -8,6 +8,6 @@ if (daysSince) {
|
|||||||
const timeSince = new Date() - new Date(dateSince);
|
const timeSince = new Date() - new Date(dateSince);
|
||||||
const endDays = Math.floor(timeSince / aDay);
|
const endDays = Math.floor(timeSince / aDay);
|
||||||
|
|
||||||
console.log(endDays);
|
const count = endDays == 1 ? `${endDays} day` : `${endDays} days`;
|
||||||
daysSince.innerHTML = `${endDays} days since last incident`
|
daysSince.innerHTML = `${count} since last incident`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user