fix #100
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 12s
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 12s
This commit is contained in:
parent
eefc750f3a
commit
f7d7b66cf6
3 changed files with 14 additions and 11 deletions
|
@ -133,9 +133,17 @@ export default async (message: Message, client: Client) => {
|
|||
}
|
||||
|
||||
// Footer
|
||||
let footer = `Posté le ${showDate(loc, quoted_post.createdAt)}`;
|
||||
let footer = `Posté le ${showDate(
|
||||
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||
loc,
|
||||
quoted_post.createdAt,
|
||||
)}`;
|
||||
if (quoted_post.editedAt) {
|
||||
footer += ` et modifié le ${showDate(loc, quoted_post.editedAt)}`;
|
||||
footer += ` et modifié le ${showDate(
|
||||
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||
loc,
|
||||
quoted_post.editedAt,
|
||||
)}`;
|
||||
}
|
||||
|
||||
let author = "Auteur";
|
||||
|
@ -143,6 +151,7 @@ export default async (message: Message, client: Client) => {
|
|||
author += " & Citateur";
|
||||
} else {
|
||||
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
|
||||
message.guild?.preferredLocale ?? client.config.default_lang,
|
||||
loc,
|
||||
message.createdAt,
|
||||
)}`;
|
||||
|
|
|
@ -414,6 +414,7 @@ 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}`,
|
||||
|
|
|
@ -5,15 +5,8 @@
|
|||
* @param date Date
|
||||
* @returns String
|
||||
*/
|
||||
export const showDate = (locale: Map<string, unknown>, date: Date) => {
|
||||
const timezoned = new Date(date.getTime() + date.getTimezoneOffset() * 60000);
|
||||
|
||||
console.log(date.getTimezoneOffset());
|
||||
|
||||
return `${timezoned.toDateString()} ${locale.get("u_time_at")} ${
|
||||
timezoned.toTimeString().split(" ")[0]
|
||||
}`;
|
||||
};
|
||||
export const showDate = (tz: string, locale: Map<string, unknown>, date: Date) =>
|
||||
date.toLocaleString(tz).replace(" ", ` ${locale.get("u_time_at")} `);
|
||||
|
||||
enum TimeSecond {
|
||||
Year = 31536000,
|
||||
|
|
Loading…
Reference in a new issue