Improve current cycle time

This commit is contained in:
Alexander Hosking 2022-04-30 01:33:09 -04:00
parent ccfa49c514
commit 43b2a1d6bb

View File

@ -17,7 +17,7 @@ def index():
db = get_db() db = get_db()
current_cycle = db.execute('SELECT * from cycle ORDER BY id DESC LIMIT 1').fetchone() current_cycle = db.execute('SELECT * from cycle ORDER BY id DESC LIMIT 1').fetchone()
start_time = pendulum.parse(current_cycle['start_time']) start_time = pendulum.parse(current_cycle['start_time'])
cycle_length = (pendulum.now() - start_time ).days cycle_length = ((pendulum.now() - start_time ).days)+1
db.execute( db.execute(
'UPDATE cycle SET cycle_length = ?' 'UPDATE cycle SET cycle_length = ?'