Lines Matching full:year
100 def isleap(year): argument
102 return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
113 def weekday(year, month, day): argument
114 """Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
115 if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
116 year = 2000 + year % 400
117 return datetime.date(year, month, day).weekday()
120 def monthrange(year, month): argument
122 year, month."""
125 day1 = weekday(year, month, 1)
126 ndays = mdays[month] + (month == February and isleap(year))
130 def monthlen(year, month): argument
131 return mdays[month] + (month == February and isleap(year))
134 def prevmonth(year, month): argument
136 return year-1, 12
138 return year, month-1
141 def nextmonth(year, month): argument
143 return year+1, 1
145 return year, month+1
173 def itermonthdates(self, year, month): argument
179 for y, m, d in self.itermonthdays3(year, month):
182 def itermonthdays(self, year, month): argument
187 day1, ndays = monthrange(year, month)
194 def itermonthdays2(self, year, month): argument
199 for i, d in enumerate(self.itermonthdays(year, month), self.firstweekday):
202 def itermonthdays3(self, year, month): argument
204 Like itermonthdates(), but will yield (year, month, day) tuples. Can be
207 day1, ndays = monthrange(year, month)
210 y, m = prevmonth(year, month)
215 yield year, month, d
216 y, m = nextmonth(year, month)
220 def itermonthdays4(self, year, month): argument
222 Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
225 for i, (y, m, d) in enumerate(self.itermonthdays3(year, month)):
228 def monthdatescalendar(self, year, month): argument
233 dates = list(self.itermonthdates(year, month))
236 def monthdays2calendar(self, year, month): argument
243 days = list(self.itermonthdays2(year, month))
246 def monthdayscalendar(self, year, month): argument
251 days = list(self.itermonthdays(year, month))
254 def yeardatescalendar(self, year, width=3): argument
256 Return the data for the specified year ready for formatting. The return
262 self.monthdatescalendar(year, i)
267 def yeardays2calendar(self, year, width=3): argument
269 Return the data for the specified year ready for formatting (similar to
275 self.monthdays2calendar(year, i)
280 def yeardayscalendar(self, year, width=3): argument
282 Return the data for the specified year ready for formatting (similar to
287 self.monthdayscalendar(year, i)
370 Returns a year's calendar as a multi-line string.
406 """Print a year's calendar."""
430 # CSS class for the year's table head
431 cssclass_year_head = "year"
433 # CSS class for the whole year table
434 cssclass_year = "year"
500 Return a formatted year as a table of tables.
524 Return a formatted year as a complete HTML page.
635 # Spacing of month columns for multi-column year calendar
641 """Prints multi-column formatting for year calendars"""
657 year, month, day, hour, minute, second = tuple[:6]
658 days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1
712 "year",
714 help="year number (1-9999)"
740 if options.year is None:
741 write(cal.formatyearpage(datetime.date.today().year, **optdict))
743 write(cal.formatyearpage(options.year, **optdict))
756 if options.year is None:
757 result = cal.formatyear(datetime.date.today().year, **optdict)
759 result = cal.formatyear(options.year, **optdict)
761 result = cal.formatmonth(options.year, options.month, **optdict)