How can I create the following calendar grid using knockout binding?:

There will be 7 columns. (one for each day). The first row (header) of the table will contain the day and date. The 2nd row will contain the values for the respective date. The next row will be another header, again followed by values. Repeat until end of the month.
I have all my data in an observable collection object:
function CalendarDate(id, date, volume) {
var self = this;
self.id = ko.observable(id);
self.date = ko.observable(date);
self.volume = ko.observable(volume);
};
function ForecastViewModel() {
var self = this;
self.dates = ko.observableArray([]);
}
I feel like I should be using a foreach binding, but can’t figure out how to wrap the grid after the 7th column.
Any ideas?
Link to demo : JsFiddle
Create 2 template and a container
First one is responsible for rendering date box :
Second one is resposible for 7 days :
Then prepare a function that splits the date array and apply the templates like this :
}
Summary :
Use ko.applyBindingsToNode function to render sub templates after prepared your array. Thats my first thought. There can be more efficient solutions.
EDIT :
Here is a simple implemantation of the idea without details : JsFiddle