Like itermonthdates(), but will yield (year, month, day) tuples. Can be used for dates outside of datetime.date range.
(self, year, month)
| 265 | yield d, i % 7 |
| 266 | |
| 267 | def itermonthdays3(self, year, month): |
| 268 | """ |
| 269 | Like itermonthdates(), but will yield (year, month, day) tuples. Can be |
| 270 | used for dates outside of datetime.date range. |
| 271 | """ |
| 272 | day1, ndays = monthrange(year, month) |
| 273 | days_before = (day1 - self.firstweekday) % 7 |
| 274 | days_after = (self.firstweekday - day1 - ndays) % 7 |
| 275 | y, m = _prevmonth(year, month) |
| 276 | end = _monthlen(y, m) + 1 |
| 277 | for d in range(end-days_before, end): |
| 278 | yield y, m, d |
| 279 | for d in range(1, ndays + 1): |
| 280 | yield year, month, d |
| 281 | y, m = _nextmonth(year, month) |
| 282 | for d in range(1, days_after + 1): |
| 283 | yield y, m, d |
| 284 | |
| 285 | def itermonthdays4(self, year, month): |
| 286 | """ |