chore: merge dev to main #177

Merged
Anri merged 6 commits from dev into main 2024-09-23 17:51:22 +02:00
3 changed files with 4 additions and 7 deletions
Showing only changes of commit 29c832367f - Show all commits

View file

@ -131,9 +131,9 @@ export default async (message: Message, client: Client) => {
}
// Footer
let footer = `Posté le ${showDate(client.config.default_lang, loc, quoted_post!.createdAt)}`;
let footer = `Posté le ${showDate(loc, quoted_post!.createdAt)}`;
if (quoted_post?.editedAt) {
footer += ` et modifié le ${showDate(client.config.default_lang, loc, quoted_post.editedAt)}`;
footer += ` et modifié le ${showDate(loc, quoted_post.editedAt)}`;
}
let author = "Auteur";
@ -141,7 +141,6 @@ export default async (message: Message, client: Client) => {
author += " & Citateur";
} else {
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
client.config.default_lang,
loc,
message.createdAt,
)}`;

View file

@ -414,7 +414,6 @@ export const embedListReminders = async (
const expiration = `${loc.get("c_reminder8")} ${timeDeltaToString(remind.expiration_date)}`;
embed.addFields({
name: `#${remind.id}${loc.get("c_reminder9")} ${showDate(
local,
loc,
new Date(Number(remind.creation_date)),
)}\n${expiration}`,

View file

@ -5,9 +5,8 @@
* @param date Date
* @returns String
*/
export const showDate = (tz: string, locale: Map<string, unknown>, date: Date) => {
return date.toLocaleString(tz).replace(" ", ` ${locale.get("u_time_at")} `);
};
export const showDate = (locale: Map<string, unknown>, date: Date) =>
`${date.toDateString()} ${locale.get("u_time_at")} ${date.toTimeString().split(" ")[0]}`;
enum TimeSecond {
Year = 31536000,