Skip to content

Commit

Permalink
Change end date to start date for upcoming events.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Moschkin committed Oct 31, 2023
1 parent e5bcb19 commit 9bfbefb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/commands/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,20 @@ async function asyncHandler(message: Message, guildConfig?: Definitions.GuildCon

// Remove from smallbonus the highbonus crew
smallbonus = smallbonus.filter((entry) => !highbonus.includes(entry));

event.endDate ??= new Date();
let reply = `Event ending on *${toTimestamp(event.endDate)}*\n\nHigh bonus crew: ${

let reply = "";
if (event.startDate && event.startDate.getTime() > (new Date()).getTime()) {
reply = `Event starting on *${toTimestamp(event.startDate)}*`;
}
else {
reply = `Event ending on *${toTimestamp(event.endDate)}*`;
}
reply += `\n\nHigh bonus crew: ${
highbonus.length === 0 ? 'NONE' : highbonus.map((entry) => entry ? eventCrewFormat(entry, profileData) : '').join(', ')
}\n\n`;

reply += `Small bonus crew: ${
smallbonus.length === 0
? 'NONE'
Expand Down

0 comments on commit 9bfbefb

Please sign in to comment.