fix time issue (#100)
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 22s
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 22s
This commit is contained in:
parent
377ee13a13
commit
29c832367f
3 changed files with 4 additions and 7 deletions
|
@ -131,9 +131,9 @@ export default async (message: Message, client: Client) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Footer
|
// 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) {
|
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";
|
let author = "Auteur";
|
||||||
|
@ -141,7 +141,6 @@ export default async (message: Message, client: Client) => {
|
||||||
author += " & Citateur";
|
author += " & Citateur";
|
||||||
} else {
|
} else {
|
||||||
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
|
footer += `\nCité par ${userWithNickname(message.member!) ?? "?"} le ${showDate(
|
||||||
client.config.default_lang,
|
|
||||||
loc,
|
loc,
|
||||||
message.createdAt,
|
message.createdAt,
|
||||||
)}`;
|
)}`;
|
||||||
|
|
|
@ -414,7 +414,6 @@ export const embedListReminders = async (
|
||||||
const expiration = `${loc.get("c_reminder8")} ${timeDeltaToString(remind.expiration_date)}`;
|
const expiration = `${loc.get("c_reminder8")} ${timeDeltaToString(remind.expiration_date)}`;
|
||||||
embed.addFields({
|
embed.addFields({
|
||||||
name: `#${remind.id} • ${loc.get("c_reminder9")} ${showDate(
|
name: `#${remind.id} • ${loc.get("c_reminder9")} ${showDate(
|
||||||
local,
|
|
||||||
loc,
|
loc,
|
||||||
new Date(Number(remind.creation_date)),
|
new Date(Number(remind.creation_date)),
|
||||||
)}\n${expiration}`,
|
)}\n${expiration}`,
|
||||||
|
|
|
@ -5,9 +5,8 @@
|
||||||
* @param date Date
|
* @param date Date
|
||||||
* @returns String
|
* @returns String
|
||||||
*/
|
*/
|
||||||
export const showDate = (tz: string, locale: Map<string, unknown>, date: Date) => {
|
export const showDate = (locale: Map<string, unknown>, date: Date) =>
|
||||||
return date.toLocaleString(tz).replace(" ", ` ${locale.get("u_time_at")} `);
|
`${date.toDateString()} ${locale.get("u_time_at")} ${date.toTimeString().split(" ")[0]}`;
|
||||||
};
|
|
||||||
|
|
||||||
enum TimeSecond {
|
enum TimeSecond {
|
||||||
Year = 31536000,
|
Year = 31536000,
|
||||||
|
|
Loading…
Reference in a new issue