Esempio n. 1
0
    def set_start_time(self, start_time):
        """ Set the start time.

        When start time is set, drop down list will start from start time,
        and duration will be displayed in brackets.

        self.time will have the same type as start_time.
        """
        start_time = hamster_round(start_time)
        if isinstance(start_time, dt.datetime):
            self.start_date = start_time.date()
            # timeinput works on time only
            start_time = start_time.time()
        else:
            self.start_date = None
        self.start_time = start_time
Esempio n. 2
0
 def time(self, value):
     time = hamster_round(value)
     self.set_text(self._format_time(time))
     return time