cs10/fa14

Week 1 JS Calendar Highlight Bug

Closed this issue · 2 comments

Argh...what am I missing....

For the first week:

        weeks = Math.floor(((today - start) / MS_DAY) / 7), // Weeks SINCE start
        rows = document.getElementsByClassName("cal"),
        temp = rows[weeks], // +1 is because row 0 is header

For every other week:

        weeks = Math.floor(((today - start) / MS_DAY) / 7), // Weeks SINCE start
        rows = document.getElementsByClassName("cal"),
        temp = rows[weeks + 1], // +1 is because row 0 is header

Currently, [weeks] just seems to work. Maybe this is a problem with weekend dates...

Ugh I think the current settings are correct but I don't know...