Ejemplo n.º 1
0
 def get_minutes_to_end(self):
     now = datetime.datetime.now()
     end = self.date + datetime.timedelta(minutes=self.duration)
     return difference_in_seconds(end, now) if self.date > now else -difference_in_seconds(now, end)
Ejemplo n.º 2
0
 def get_minutes_to_start(self):
     now = datetime.datetime.now()
     return difference_in_seconds(self.date, now) if self.date > now else -difference_in_seconds(now, self.date)