Filters: Fix date defaults when no hands inserted

This commit is contained in:
Worros 2010-11-10 12:46:48 +08:00
parent 1a96892ec4
commit a4facf0c2a

View File

@ -1060,12 +1060,18 @@ class Filters(threading.Thread):
if t1 == '':
self.cursor.execute(self.sql.query['get_first_date'])
result = self.db.cursor.fetchall()
if result[0][0] == None:
t1 = '1970-01-02'
else:
t1 = result[0][0].split()[0]
self.start_date.set_text(t1)
if t2 == '':
self.cursor.execute(self.sql.query['get_last_date'])
result = self.db.cursor.fetchall()
if result[0][0] == None:
t2 = '2020-12-12'
else:
t2 = result[0][0].split()[0]
self.end_date.set_text(t2)