The one problem I found was that "Last Month" was being calculated incorrectly. Below is the simple fix. Thanks to epalla for the original code.
// last month
// we need a new month variable for month-1, also formatted correctly
var lastmonth = ((month - 1) < 10) ? "0" + (month - 1) : (month - 1);
startbox.value = lastmonth + "/01/" + year;
// now grab the last day of the month (30, 31? we don't know!)
var moend = new Date(year, (month - 1), 0);
endbox.value = lastmonth + "/" + moend.getDate() + "/" + year;