summaryrefslogtreecommitdiffstats
path: root/pages/vms.py
diff options
context:
space:
mode:
Diffstat (limited to 'pages/vms.py')
-rw-r--r--pages/vms.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/pages/vms.py b/pages/vms.py
index f0b9a05..c9ca141 100644
--- a/pages/vms.py
+++ b/pages/vms.py
@@ -33,6 +33,7 @@ def layout():
date=get_newest_date(),
display_format='DD-MM-YYYY',
max_date_allowed=get_newest_date(),
+ min_date_allowed=get_oldest_date(),
initial_visible_month=get_newest_date(),
first_day_of_week=1,
persistence=True,
@@ -143,3 +144,15 @@ def get_newest_date():
db.closeConnection(dbcon)
return data[0]['date']
+
+def get_oldest_date():
+ dbcon = db.getConnection()
+ cursor = dbcon.cursor()
+
+ cursor.execute("""SELECT date FROM reports ORDER BY date ASC LIMIT 1""")
+
+ data = cursor.fetchall()
+
+ db.closeConnection(dbcon)
+ return data[0]['date']
+