If there are no months, use days to determine linking verb

This commit is contained in:
Daniel Odendahl Jr
2018-09-20 20:25:44 +00:00
parent 325615fe7d
commit 119723ae5b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class DaysUntilCommand extends Command {
const future = new Date(`${month}/${day}/${year}`);
const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY');
const time = moment.duration(future - now);
const link = time.months() === 1 ? 'is' : 'are';
const link = time.months() ? time.months() === 1 ? 'is' : 'are' : time.days() === 1 ? 'is' : 'are';
return msg.say(`There ${link} ${time.format('M [months and] d [days]')} until ${futureFormat}!`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "91.8.10",
"version": "91.8.11",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {