Like itermonthdates(), but will yield day numbers. For days outside the specified month the day number is 0.
(self, year, month)
| 245 | yield datetime.date(y, m, d) |
| 246 | |
| 247 | def itermonthdays(self, year, month): |
| 248 | """ |
| 249 | Like itermonthdates(), but will yield day numbers. For days outside |
| 250 | the specified month the day number is 0. |
| 251 | """ |
| 252 | day1, ndays = monthrange(year, month) |
| 253 | days_before = (day1 - self.firstweekday) % 7 |
| 254 | yield from repeat(0, days_before) |
| 255 | yield from range(1, ndays + 1) |
| 256 | days_after = (self.firstweekday - day1 - ndays) % 7 |
| 257 | yield from repeat(0, days_after) |
| 258 | |
| 259 | def itermonthdays2(self, year, month): |
| 260 | """ |