Exemplo n.º 1
0
    def set_fs_time_limits_slot(self, limits: tuple):
        """Shows active days based on the millisecond timestamp limits
        """
        self.day_min = datetime.date.fromtimestamp(limits[0] / 1000)
        self.day_max = datetime.date.fromtimestamp(limits[1] / 1000)
        # print("CalendarWidget: set_fs_time_limits_slot %s -> %s" %(str(self.day_min), str(self.day_max))) # TODO: proper logging

        self.setDateRange(
            QtCore.QDate(self.day_min.year, self.day_min.month,
                         self.day_min.day),
            QtCore.QDate(self.day_max.year, self.day_max.month,
                         self.day_max.day))
Exemplo n.º 2
0
 def setDay(self, day: datetime.date):
     """Setting the day acts as a global initializator
     """
     assert (isinstance(day, datetime.date))
     self.day = day
     # from datetime.date to Qt's QDate
     self.qday = QtCore.QDate(self.day.year, self.day.month, self.day.day)
     self.setSelectedDate(self.qday)