From 1d0502f6ab8cb282d59ce9436d1e9b39e4892b08 Mon Sep 17 00:00:00 2001 From: AyushStarGupta <37546890+AyushCodez@users.noreply.github.com> Date: Sun, 20 Feb 2022 12:18:54 +0530 Subject: [PATCH] bug fix if start, end date was same, would raise error --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 1f9f232..2444b39 100644 --- a/main.py +++ b/main.py @@ -231,8 +231,8 @@ def switch_tab2(*args): date1 = datetime.strptime( cal_tab2.get_date() + f' {a}:{b}:00', '%Y-%m-%d %H:%M:%S') date2 = datetime.strptime( - cal1_tab2.get_date() + f' {a1}:{b1}:59', '%Y-%m-%d %H:%M:%S') - if date1 > date2: + cal1_tab2.get_date() + f' {a1}:{b1}:00', '%Y-%m-%d %H:%M:%S') + if date1 >= date2: button2.config(state='disabled') else: button2.config(state='normal') @@ -363,8 +363,8 @@ def switch(*args): date1 = datetime.strptime( cal_var.get() + f' {a}:{b}:00', '%Y-%m-%d %H:%M:%S') date2 = datetime.strptime( - cal1.get_date() + f' {a1}:{b1}:59', '%Y-%m-%d %H:%M:%S') - if date1 > date2: + cal1.get_date() + f' {a1}:{b1}:00', '%Y-%m-%d %H:%M:%S') + if date1 >= date2: button1.config(state='disabled') else: button1.config(state='normal')