From d6ae6bb9c24850b9b937a848c5dc3e2342773d87 Mon Sep 17 00:00:00 2001 From: Guido de Jong <35309288+guidojw@users.noreply.github.com> Date: Fri, 22 Sep 2023 00:13:22 +0200 Subject: [PATCH] fix: change unix timestamp formats to seconds (#601) --- .../application-commands/slash-commands/admin/trainings.ts | 4 ++-- src/jobs/announce-trainings.ts | 6 ++---- src/services/group.ts | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/interactions/application-commands/slash-commands/admin/trainings.ts b/src/interactions/application-commands/slash-commands/admin/trainings.ts index 33506556..f549132e 100644 --- a/src/interactions/application-commands/slash-commands/admin/trainings.ts +++ b/src/interactions/application-commands/slash-commands/admin/trainings.ts @@ -237,8 +237,8 @@ export default class TrainingsCommand extends SubCommandCommand`, inline: true }, - { name: 'Time', value: ``, inline: true }, + { name: 'Date', value: ``, inline: true }, + { name: 'Time', value: ``, inline: true }, { name: 'Host', value: username, inline: true } ]) .setColor(context.primaryColor ?? applicationConfig.defaultColor) diff --git a/src/jobs/announce-trainings.ts b/src/jobs/announce-trainings.ts index 2117c043..a23ba836 100644 --- a/src/jobs/announce-trainings.ts +++ b/src/jobs/announce-trainings.ts @@ -81,8 +81,6 @@ async function getTrainingsEmbed (groupId: number, trainings: Training[], author const types = Object.keys(groupedTrainings) const embed = new EmbedBuilder() - .setFooter({ text: 'Updated at' }) - .setTimestamp() for (let i = 0; i < types.length; i++) { const type = types[i] @@ -110,7 +108,7 @@ function getTrainingMessage (training: Training, authors: GetUsers): string { const date = new Date(training.date) const author = authors.find(author => author.id === training.authorId) - let result = `:calendar_spiral: at hosted by ${author?.name ?? training.authorId}` + let result = `:calendar_spiral: at hosted by ${author?.name ?? training.authorId}` if (training.notes !== null) { result += `\n> :notepad_spiral: ${training.notes}` @@ -122,7 +120,7 @@ function getNextTrainingMessage (training: Training, authors: GetUsers): string const date = new Date(training.date) const author = authors.find(author => author.id === training.authorId) - let result = `${training.type?.abbreviation ?? '(Deleted)'} training on at hosted by ${author?.name ?? training.authorId}` + let result = `${training.type?.abbreviation ?? '(Deleted)'} training on at hosted by ${author?.name ?? training.authorId}` if (training.notes !== null) { result += `\n${training.notes}` diff --git a/src/services/group.ts b/src/services/group.ts index 3478c09a..4a2ee0b1 100644 --- a/src/services/group.ts +++ b/src/services/group.ts @@ -148,7 +148,7 @@ export function getTrainingRow (training: Training, { users }: { users: GetUsers const username = users.find(user => user.id === training.authorId)?.name ?? training.authorId const date = new Date(training.date) - return `${training.id}. **${training.type?.abbreviation ?? '??'}** training on at , hosted by **${username}**.` + return `${training.id}. **${training.type?.abbreviation ?? '??'}** training on at , hosted by **${username}**.` } export function groupTrainingsByType (trainings: Training[]): Record {