rem: if (firstDate.weekday < weekStart) { 
add: if (aStart.startOfMonth.weekday < weekStart) { 
context: function monthPrint_getHTML(aStart, aItems) {    var weekStart = getPrefSafe("calendar.week.start", 0);    var monthTable = <table style='border:1px solid black;' width='100%'/>    var dayNameRow = <tr/>    for (var i = 0; i < 7; i++) {        var dayName = calGetString("dateFormat", "day."+ (((weekStart+i)%7)+1) + ".Mmm");        dayNameRow.appendChild(<td class='day-name' align='center'>{dayName}</td>);    }    monthTable.appendChild(dayNameRow);    // Set up the item-list so it's easy to work with.    function hasUsableDate(item) {        return item.startDate || item.entryDate || item.dueDate;    }    var filteredItems = aItems.filter(hasUsableDate);    var calIEvent = Components.interfaces.calIEvent;    var calITodo = Components.interfaces.calITodo    function compareItems(a, b) {        // Sort tasks before events        if (a instanceof calIEvent && b instanceof calITodo) {            return 1;        }        if (a instanceof calITodo && b instanceof calIEvent) {            return -1;        }        if (a instanceof calIEvent) {            var startCompare = a.startDate.compare(b.startDate);            if (startCompare != 0) {                return startCompare;            }            return a.endDate.compare(b.endDate);        }        var aDate = a.entryDate || a.dueDate;        var bDate = b.entryDate || b.dueDate;        return aDate.compare(bDate);    }    var sortedList = filteredItems.sort(compareItems);    var firstDate = aStart.startOfMonth.startOfWeek.clone();    firstDate.day += weekStart;    firstDate.normalize();    if (firstDate.weekday < weekStart) {        // Go back one week to make sure we display this day        firstDate.day -= 7;        firstDate.normalize();    }    var lastDate = aStart.endOfMonth.endOfWeek.clone();    if (lastDate.weekday < weekStart) {        // Go back one week so we don't display any extra days        lastDate.day -= 7;        lastDate.normalize();    }    firstDate.isDate = true;    lastDate.isDate = true;    var date = firstDate.clone();    var itemListIndex = 0;    while (date.compare(lastDate) != 1) {        monthTable.appendChild(this.makeHTMLWeek(date, sortedList, aStart.month));    }    return monthTable;};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/9c373787309dfd43890e4d219ecd353e54054398/calMonthGridPrinter.js/clean/calendar/import-export/calMonthGridPrinter.js