The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

which works…*but only once. The counter being set back to 0 isn't getting sent because the row_end is instead (since it's the last one, correct?). SO, in this instance, is it just necessary to have logic in the view sometimes?

By the way, the goal here is to end a row for a calendar and start a new one.

your brain reacts in the same way whether you are
looking at something or thinking about it...

always yielding a number between 0 and 6 in counter, then decide whether 0 or six triggers your rowend.

Or, if you're feeling expansive, you could generate an array for the Calendar days (let's assume you want Sunday as 1st day of week and the month starts on Tues, the array starts with 0,0,1,.... to indicate the blank days, likewise zero- fill the back end till it reaches a multiple of 7). Then you could slice the top 7 elements of the array and feed them to a partial which starts the row, and feeds each day to a partial that renders the day, and after the second partial finishes the first closes the row.

Strictly speaking, the function you gave is faulty, because the the week_row doesn't end with "</tr><tr>", it ends with "</tr>" and the next row shouldn't be started unless you have data for it.