fix(ui): Second shouldn't be plural if value is 1

This commit is contained in:
TwiN 2022-06-12 17:56:14 -04:00
parent f9efa28223
commit c31cb7540d

View File

@ -14,7 +14,8 @@ export const helper = {
let minutes = (differenceInMs / 60000).toFixed(0);
return minutes + " minute" + (minutes !== "1" ? "s" : "") + " ago";
}
return (differenceInMs / 1000).toFixed(0) + " seconds ago";
let seconds = (differenceInMs / 1000).toFixed(0);
return seconds + " second" + (seconds !== "1" ? "s" : "") + " ago";
},
prettifyTimestamp(timestamp) {
let date = new Date(timestamp);