def FirstDayOfWeek(self, targetDate): """ rewind the selected date to the previous specified date Unfortunately, firstDayOfWeek has sunday = 1, and weekday() has monday=0, so they're actually off by 2! """ return getCalendarRange(targetDate, 'week', self.firstDayOfWeek)[0]
def InMonth(self, dt): start, end = getCalendarRange(self.selectedDate, 'multiweek', self.firstDayOfWeek) return start <= dt < end