calendar.js ============ Functions inspired by the calendar module from the Python standard library. The `monthDates` function builds an array of weeks to display one month, starting on Sunday (default) or Monday. Each week is an array of seven Date instances, including dates from the month before or after, as needed to fill the first and last weeks. Optional formatting functions may be passed as third and fourth arguments: one to format each date, the other to format each week. > cal = new c.Calendar(); // weeks start on Sunday by default > m = cal.monthDates(2012,0, // January is 0 in JS Date ... function(d) {return (' '+d.getDate()).slice(-2)}, ... function(w) {return w.join(' | ')} ); > for (i=0; i cal = new Calendar(1); // weeks starting on Monday > m = cal.monthDays(2012, 1); > for (i=0; i