diff --git a/timetagger/app/dialogs.py b/timetagger/app/dialogs.py index 76604ec..638c727 100644 --- a/timetagger/app/dialogs.py +++ b/timetagger/app/dialogs.py @@ -1072,10 +1072,10 @@ def onchanged(self, action): mm, ss = mm + self._stepwise_delta(mm, -(_stepsize)), 0 d1 = window.Date(year1, month1 - 1, day1, hh, mm, ss) self.t1 = dt.to_time_int(d1) - if self.ori_t1 == self.ori_t2: - self.t2 = self.t1 = min(self.t1, now) - elif self.t1 >= self.t2: - self.t2 = self.t1 + 1 + if self.ori_t1 == self.ori_t2: + self.t2 = self.t1 = min(self.t1, now) + elif self.t1 >= self.t2: + self.t2 = self.t1 + 1 elif what == "time2": # Changing time2 -> update t2, keep t1 and t2 in check @@ -1094,11 +1094,11 @@ def onchanged(self, action): mm, ss = mm + self._stepwise_delta(mm, -(_stepsize)), 0 d2 = window.Date(year2, month2 - 1, day2, hh, mm, ss) self.t2 = dt.to_time_int(d2) - if self.ori_t1 == self.ori_t2: - self.t2 = self.t1 - elif self.t2 <= self.t1: - self.t1 = self.t2 - self.t2 = self.t1 + 1 + if self.ori_t1 == self.ori_t2: + self.t2 = self.t1 + elif self.t2 <= self.t1: + self.t1 = self.t2 + self.t2 = self.t1 + 1 elif what == "duration": # Changing duration -> update t2, but keep it in check @@ -2065,7 +2065,7 @@ def open(self, tags, callback): def _make_click_handler(self, tag, callback): def handler(): self.close() - (self._canvas.tag_dialog.open(tag, callback),) + self._canvas.tag_dialog.open(tag, callback) return handler