Skip to content

Commit 2f82d41

Browse files
authored
Fix time formatting (#34) (#108)
Also fixes a local warning for Husky
1 parent 00c2bde commit 2f82d41

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

.husky/post-merge

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
#!/usr/bin/env bash
52
# MIT © Sindre Sorhus - sindresorhus.com
63
# https://gist.github.com/sindresorhus/7996717

.husky/pre-push

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
21
npm run validate

app/helpers/modLog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const constructLog = async ({
205205
lastReport.message.author.username
206206
}) warned ${previousWarnings.size + 1} times recently, posted in ${
207207
logs.length
208-
} channels ${formatDistanceToNowStrict(lastReport.message.createdAt)} ago`;
208+
} channels ${formatDistanceToNowStrict(lastReport.message.createdAt)} before this log (<t:${Math.floor(lastReport.message.createdTimestamp / 1000)}:R>)`;
209209
const extra = origExtra ? `${origExtra}\n` : "";
210210

211211
// If it has the data for a poll, use a specialized formatting function
@@ -217,7 +217,7 @@ const constructLog = async ({
217217
warnings.push(
218218
`[${format(logMessage.createdAt, "PP kk:mmX")}](${constructDiscordLink(
219219
logMessage,
220-
)}) (<t:${logMessage.createdAt}:R>)`,
220+
)}) (<t:${Math.floor(logMessage.createdAt.getTime() / 1000)}:R>)`,
221221
);
222222
}
223223

0 commit comments

Comments
 (0)