From 40c38ba2991945233ae4061724f9e5f414a98398 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 28 Oct 2020 20:53:49 -0400 Subject: [PATCH] show expiration in embed --- src/commands/score.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/score.ts b/src/commands/score.ts index ce0891e..1b570af 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -165,7 +165,7 @@ export default class Score extends Command { score.inquiries.forEach((inq) => { const testDate = (new Date(new Date(inq.date).setHours(1460))); // eslint-disable-next-line no-useless-escape - if (testDate > new Date()) desc += `${inq.id ? `__[${inq.id}]__\n` : ''}**Department/Service:** ${inq.name.replace(/\*/gmi, '')}\n**Reason:** ${inq.reason}\n**Date:** ${inq.date.toLocaleString('en-us')} ET\n**Expires:** ${moment(testDate).fromNow()} | ${moment(testDate).calendar()}\n\n`; + if (testDate > new Date()) desc += `${inq.id ? `__[${inq.id}]__\n` : ''}**Department/Service:** ${inq.name.replace(/\*/gmi, '')}\n**Reason:** ${inq.reason}\n**Date:** ${inq.date.toLocaleString('en-us')} ET\n**Expires:** ${moment(testDate).calendar()}\n\n`; }); embed.setDescription(desc); }