From 6485d94a55d491ddd9c8f16faaa4938de0ccc7eb Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 28 Oct 2020 20:33:21 -0400 Subject: [PATCH] add things --- src/commands/score.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/score.ts b/src/commands/score.ts index cf0c566..b7feaa4 100644 --- a/src/commands/score.ts +++ b/src/commands/score.ts @@ -1,5 +1,6 @@ /* eslint-disable no-continue */ /* eslint-disable default-case */ +import moment from 'moment'; import { v4 as uuid } from 'uuid'; import { Message, User, TextChannel } from 'eris'; import { Client, Command, RichEmbed } from '../class'; @@ -164,7 +165,7 @@ export default class Score extends Command { score.inquiries.forEach((inq) => { const testDate = (new Date(new Date(inq.date).setHours(2190))); // 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\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).fromNow()} | ${moment(testDate).calendar()}\n\n`; }); embed.setDescription(desc); }