fixed broken home page notices

This commit is contained in:
Alphons
2024-02-09 20:29:27 +08:00
parent f3e7e7df55
commit 7f60c9904c
+3 -2
View File
@@ -2278,7 +2278,7 @@ async function loadHomePage() {
// 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()
date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? '0' : '') + (date.getMonth() + 1) + '-' + (date.getDate() < 10 ? '0' : '') + date.getDate()
callHomeTimetable(TodayFormatted, true)
@@ -2490,7 +2490,8 @@ async function loadHomePage() {
}
// Data sent as the POST request
const dateControl = document.querySelector('input[type="date"]') as HTMLInputElement
xhr2.send(JSON.stringify({ date: dateControl!.value }))
console.log(dateControl.value)
xhr2.send(JSON.stringify({ date: dateControl.value }))
function onInputChange (e: any) {
xhr2.open('POST', `${location.origin}/seqta/student/load/notices?`, true)
xhr2.setRequestHeader('Content-Type', 'application/json; charset=utf-8')