From 7a9fc9c58ccc432697aed7c5a994f994952545bc Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 9 Jan 2021 10:47:10 -0500 Subject: [PATCH] Fix --- commands/events/days-until.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/events/days-until.js b/commands/events/days-until.js index aa1cc4d6..8034f15b 100644 --- a/commands/events/days-until.js +++ b/commands/events/days-until.js @@ -43,6 +43,7 @@ module.exports = class DaysUntilCommand extends Command { const future = new Date(year, month - 1, day); const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY'); const time = moment.duration(future - now); + if (time < 0) return msg.say('This date has already passed!'); const link = time.months() ? time.months() === 1 ? 'is' : 'are' : time.days() === 1 ? 'is' : 'are'; return msg.say(`There ${link} ${time.format('Y [years], M [months and] d [days]')} until ${futureFormat}!`); }