From 384630bc6c5eb8d38fc40230a5a3e645ad785c2d Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Wed, 24 Jan 2024 10:10:04 +1100 Subject: [PATCH] reformat homepage function --- src/SEQTA.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/SEQTA.ts b/src/SEQTA.ts index 912c74eb..e2e546ca 100644 --- a/src/SEQTA.ts +++ b/src/SEQTA.ts @@ -2218,25 +2218,23 @@ async function loadHomePage() { // Gets the current date const date = new Date() - // Formats the current date used send a request for timetable and notices later - const TodayFormatted = - date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate() < 10 ? '0' : '') + date.getDate() - - + + // Creates the shortcut container into the home container const Shortcut = stringToHTML('
') // Appends the shortcut container into the home container document.getElementById('home-container')!.append(Shortcut.firstChild!) - + // Creates the container div for the timetable portion of the home page const Timetable = stringToHTML('

Today\'s Lessons

') // Appends the timetable container into the home container document.getElementById('home-container')!.append(Timetable.firstChild!) - if (document.getElementById('home-container')) { - callHomeTimetable(TodayFormatted, true) - } else { - console.error("HELP! THERE IS NO HOME CONTAINER") - } + + // Formats the current date used send a request for timetable and notices later + const TodayFormatted = + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate() < 10 ? '0' : '') + date.getDate() + + callHomeTimetable(TodayFormatted, true) const timetablearrowback = document.getElementById('home-timetable-back')