Skip to content

Commit 61e0fd1

Browse files
committed
chore: reorder code
1 parent 8193569 commit 61e0fd1

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

frontend/src/ts/pages/leaderboards.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,26 @@ function readGetParameters(): void {
12251225
}
12261226
}
12271227

1228+
function utcToLocalDate(timestamp: UTCDateMini): Date {
1229+
return subMinutes(timestamp, new Date().getTimezoneOffset());
1230+
}
1231+
1232+
function updateTimeText(
1233+
dateString: string,
1234+
localStart: Date,
1235+
localEnd: Date
1236+
): void {
1237+
const localDateString =
1238+
"local time \n" +
1239+
format(localStart, localDateFormat) +
1240+
" - \n" +
1241+
format(localEnd, localDateFormat);
1242+
1243+
const text = $(".page.pageLeaderboards .bigtitle .subtext > .text");
1244+
text.text(`${dateString}`);
1245+
text.attr("aria-label", localDateString);
1246+
}
1247+
12281248
$(".page.pageLeaderboards .jumpButtons button").on("click", function () {
12291249
const action = $(this).data("action") as string;
12301250
if (action !== "goToPage") {
@@ -1320,23 +1340,3 @@ export const page = new Page({
13201340
$(async () => {
13211341
Skeleton.save("pageLeaderboards");
13221342
});
1323-
1324-
function utcToLocalDate(timestamp: UTCDateMini): Date {
1325-
return subMinutes(timestamp, new Date().getTimezoneOffset());
1326-
}
1327-
1328-
function updateTimeText(
1329-
dateString: string,
1330-
localStart: Date,
1331-
localEnd: Date
1332-
): void {
1333-
const localDateString =
1334-
"local time \n" +
1335-
format(localStart, localDateFormat) +
1336-
" - \n" +
1337-
format(localEnd, localDateFormat);
1338-
1339-
const text = $(".page.pageLeaderboards .bigtitle .subtext > .text");
1340-
text.text(`${dateString}`);
1341-
text.attr("aria-label", localDateString);
1342-
}

0 commit comments

Comments
 (0)