Revert "calendar displays current entry value"

This reverts commit f78044e4c1.

Conflicts:

	pyfpdb/Filters.py
This commit is contained in:
Worros 2010-11-10 16:36:58 +08:00
parent 8da12d91a8
commit 31843deafe

View File

@ -1014,25 +1014,6 @@ class Filters(threading.Thread):
vb = gtk.VBox() vb = gtk.VBox()
cal = gtk.Calendar() cal = gtk.Calendar()
if entry == self.start_date:
cal_date = self.start_date.get_text()
if cal_date == '':
self.cursor.execute(self.sql.query['get_first_date'])
result = self.db.cursor.fetchall()
cal_date = result[0][0].split()[0]
self.start_date.set_text(cal_date)
elif entry == self.end_date:
cal_date = self.end_date.get_text()
if cal_date == '':
self.cursor.execute(self.sql.query['get_last_date'])
result = self.db.cursor.fetchall()
cal_date = result[0][0].split()[0]
self.end_date.set_text(cal_date)
(year,month,day)=cal_date.split('-')
cal.select_month(int(month)-1, int(year))
cal.select_day(int(day))
vb.pack_start(cal, expand=False, padding=0) vb.pack_start(cal, expand=False, padding=0)
btn = gtk.Button(_('Done')) btn = gtk.Button(_('Done'))
@ -1058,22 +1039,9 @@ class Filters(threading.Thread):
t2 = self.end_date.get_text() t2 = self.end_date.get_text()
if t1 == '': 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' t1 = '1970-01-02'
else:
t1 = result[0][0].split()[0]
self.start_date.set_text(t1)
if t2 == '': 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' t2 = '2020-12-12'
else:
t2 = result[0][0].split()[0]
self.end_date.set_text(t2)
s1 = strptime(t1, "%Y-%m-%d") # make time_struct s1 = strptime(t1, "%Y-%m-%d") # make time_struct
s2 = strptime(t2, "%Y-%m-%d") s2 = strptime(t2, "%Y-%m-%d")