Skip to content

Commit f7da3ca

Browse files
authored
fix: use time function to generate timestamps properly (#124)
1 parent 61c97fd commit f7da3ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands/draft.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import assert from 'assert'
2+
import { time } from 'discord.js'
23
import {
34
SlashCommand,
45
SlashCreator,
@@ -108,7 +109,7 @@ ${draft.content}
108109
109110
id: ${draft.id}
110111
author: ${draft.author.user.tag}
111-
timestamp: ${draft.timestamp.toLocaleString()}
112+
timestamp: ${time(draft.timestamp, 'f')} (${time(draft.timestamp, 'R')})
112113
`
113114
}
114115

@@ -285,7 +286,7 @@ ${current.content}
285286
286287
id: ${current.id}
287288
author: ${current.author.user.tag}
288-
timestamp: <t:${current.timestamp.getUTCMilliseconds()}:f> (<t:${current.timestamp.getUTCMilliseconds()}:R>)
289+
timestamp: ${time(current.timestamp, 'f')} (${time(current.timestamp, 'R')})
289290
`,
290291
ctx,
291292
extraOpts: {

0 commit comments

Comments
 (0)