mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
Merge pull request #321 from Jones8683/main
feat: apply 12 hour time to timetable details
This commit is contained in:
@@ -37,6 +37,20 @@ function updateTimeElements(): void {
|
||||
const end12 = convertTo12HourFormat(end).toLowerCase().replace(" ", "");
|
||||
el.textContent = `${start12}–${end12}`;
|
||||
});
|
||||
|
||||
const quickbarTimes = document.querySelectorAll<HTMLElement>(".quickbar .meta .times");
|
||||
quickbarTimes.forEach((el) => {
|
||||
if (!el.dataset.original) el.dataset.original = el.textContent || "";
|
||||
const original = el.dataset.original || "";
|
||||
|
||||
if (!original.includes("–") && !original.includes("-")) return;
|
||||
const [start, end] = original.split(/[-–]/).map((p) => p.trim());
|
||||
|
||||
if (!start || !end) return;
|
||||
const start12 = convertTo12HourFormat(start).toLowerCase().replace(" ", "");
|
||||
const end12 = convertTo12HourFormat(end).toLowerCase().replace(" ", "");
|
||||
el.textContent = `${start12}–${end12}`;
|
||||
});
|
||||
}
|
||||
|
||||
function checkIfOnTimetablePage(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user