feat(dynamic timestamp): add dynamic discord timestamps

This commit is contained in:
Dominik Koch
2024-12-11 21:18:01 +00:00
parent 3b2440b1db
commit a08ba7e8b5
5 changed files with 15 additions and 10 deletions
@@ -12,6 +12,7 @@ import {
export const sendDokployRestartNotifications = async () => {
const date = new Date();
const unixDate = ~~((Number(date)) / 1000);
const notificationList = await db.query.notifications.findMany({
where: eq(notifications.dokployRestart, true),
with: {
@@ -39,12 +40,12 @@ export const sendDokployRestartNotifications = async () => {
fields: [
{
name: "`📅`・Date",
value: date.toLocaleDateString(),
value: `<t:${unixDate}:D>`,
inline: true,
},
{
name: "`⌚`・Time",
value: date.toLocaleTimeString(),
value: `<t:${unixDate}:t>`,
inline: true,
},
{