示例#1
0
 def _check_date(self, day_number):
     '''
     E.g. It may happen that text is edited on the 31.7. and then the month
     is changed to June. There is no 31st in June, so we don't mark anything
     in the calendar. This behaviour is necessary since we use the calendar
     both for navigating and showing the current date.
     '''
     cal_year, cal_month, _cal_day = self.calendar.get_date()
     cal_month += 1
     if day_number not in range(1, dates.get_number_of_days(cal_year, cal_month) + 1):
         logging.debug(
             'Non-existent date in calendar: %s.%s.%s' %
             (day_number, cal_month, cal_year))
         return False
     return True
示例#2
0
 def _check_date(self, day_number):
     '''
     E.g. It may happen that text is edited on the 31.7. and then the month
     is changed to June. There is no 31st in June, so we don't mark anything
     in the calendar. This behaviour is necessary since we use the calendar
     both for navigating and showing the current date.
     '''
     cal_year, cal_month, _cal_day = self.calendar.get_date()
     cal_month += 1
     if day_number not in range(
             1,
             dates.get_number_of_days(cal_year, cal_month) + 1):
         logging.debug('Non-existent date in calendar: %s.%s.%s' %
                       (day_number, cal_month, cal_year))
         return False
     return True