I am changing the calendar plugin. The plugin adds class today to today's date. I would like to add the class "foo" to "today" and the next 2 days after that.
Instead of each month being 1 unordered list, the plugin generates a new unordered list for each row.
What would be the best way to find matching list items when they intersect with different parent items?
Case 1
<ul>
<li class="day"></li>
<li class="day"></li>
<li class="day today foo"></li>
<li class="day foo"></li>
<li class="day foo"></li>
<li class="day"></li>
<li class="day"></li>
</ul>
Case 2
<ul>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day today foo"></li>
</ul>
<ul>
<li class="day foo"></li>
<li class="day foo"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
<li class="day"></li>
</ul>
I looked at .find, .nextAll, .nextUntil, but don't know how to do this. Or do I need to create an array with all the days, and then split it for today or something else?