Building a 2D array "month view" for a given date
I have only minor comments.



This logic appears twice, do is a good candidate to extract to a helper function to eliminate duplicate code:


(startDay.getDay() + 6) % 7;





Instead of this:


// If the month didn't start on a Monday, start from the last Monday of the previous month
startDay.setDate(startDay.getDate() - startDow);



It would be slightly more readable to move this code into a helper function with a descriptive name, for example:

function getStartingMonday(startDay, startDow) {
    // If the month didn't start on a Monday, start from the last Monday of the previous month
    return new Date(startDay.getDate() - startDow));
}


This way, the code in the caller will be shorter, and the implementation detail is not really important, it's enough to know that the returned date is the sizing day and it's a Monday.

The same goes for getting the last Sunday.



You're using semicolons inconsistently, sometimes omitting it. It would be better to use a consistent style, for example put it always.



The === is redundant here:


    if (week.length === 7){



You create week yourself, inside the function, so you know it's an array, and therefore must have an integer .length property, so a simple == is enough.