chore: reorder code

This commit is contained in:
Miodec 2025-03-04 19:08:22 +01:00
parent 8193569a01
commit 61e0fd1590

View file

@ -1225,6 +1225,26 @@ function readGetParameters(): void {
}
}
function utcToLocalDate(timestamp: UTCDateMini): Date {
return subMinutes(timestamp, new Date().getTimezoneOffset());
}
function updateTimeText(
dateString: string,
localStart: Date,
localEnd: Date
): void {
const localDateString =
"local time \n" +
format(localStart, localDateFormat) +
" - \n" +
format(localEnd, localDateFormat);
const text = $(".page.pageLeaderboards .bigtitle .subtext > .text");
text.text(`${dateString}`);
text.attr("aria-label", localDateString);
}
$(".page.pageLeaderboards .jumpButtons button").on("click", function () {
const action = $(this).data("action") as string;
if (action !== "goToPage") {
@ -1320,23 +1340,3 @@ export const page = new Page({
$(async () => {
Skeleton.save("pageLeaderboards");
});
function utcToLocalDate(timestamp: UTCDateMini): Date {
return subMinutes(timestamp, new Date().getTimezoneOffset());
}
function updateTimeText(
dateString: string,
localStart: Date,
localEnd: Date
): void {
const localDateString =
"local time \n" +
format(localStart, localDateFormat) +
" - \n" +
format(localEnd, localDateFormat);
const text = $(".page.pageLeaderboards .bigtitle .subtext > .text");
text.text(`${dateString}`);
text.attr("aria-label", localDateString);
}