'Return an iterator for one month. The iterator will yield datetime.date
values and will always iterate through complete weeks, so it will yield
dates outside the specified month.'

def itermonthdates(self, year, month):

    date = datetime.date(year, month, 1)
    days = ((date.weekday() - self.firstweekday) % 7)
    date -= datetime.timedelta(days=days)
    oneday = datetime.timedelta(days=1)
    while True:
        (yield date)
        try:
            date += oneday
        except OverflowError:
            break
        if ((date.month != month) and (date.weekday() == self.firstweekday)):
            break
