mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 14:19:56 +02:00
If there are no months, use days to determine linking verb
This commit is contained in:
@@ -33,7 +33,7 @@ module.exports = class DaysUntilCommand extends Command {
|
|||||||
const future = new Date(`${month}/${day}/${year}`);
|
const future = new Date(`${month}/${day}/${year}`);
|
||||||
const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY');
|
const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY');
|
||||||
const time = moment.duration(future - now);
|
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}!`);
|
return msg.say(`There ${link} ${time.format('M [months and] d [days]')} until ${futureFormat}!`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "91.8.10",
|
"version": "91.8.11",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user