This commit is contained in:
Daniel Odendahl Jr
2017-09-21 22:48:34 +00:00
parent 676ec61258
commit 3c276190df
+1 -1
View File
@@ -22,7 +22,7 @@ module.exports = class DaysUntilCommand extends Command {
run(msg, { date }) {
const month = parseInt(date[0], 10);
const day = parseInt(date[1], 10);
const day = date[1] ? parseInt(date[1], 10) : NaN;
const now = new Date();
let year = now.getMonth() + 1 <= month ? now.getFullYear() : now.getFullYear() + 1;
if (month === now.getMonth() + 1 && now.getDate() >= day) ++year;