I have objects representing the days of the week:
var sunday = {
time7 : "hello",
time75 : "get up",
time8 : "brush your teeth"
};
var monday = {
time7 : "hello",
time75 : "get up",
time8 : "brush your teeth"
};
etc...
I then have a function which checks the day and time, and then updates the webpage:
function schedgie() {
var now = new Date();
var day = now.getDay();
var hour = now.getHours();
var minute = now.getMinutes();
var dayRange = ["sunday","monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
var today = dayRange[day];
if ((hour == "7") && (minute >= "0" && minute <= "29")) {
document.getElementById("max").innerHTML = today.time7;
}
if ((hour == "7") && (minute >= "30" && minute <= "59")) {
document.getElementById("max").innerHTML = today.time75;
}
};
The "today" variable however is not referencing the object name as I hoped. Any assistance would be greatly appreciated. Thank you!