From 5c48e008ee4a8dd6b6e8605ab72914cdf7d756b2 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Fri, 26 Sep 2025 19:00:46 -0700 Subject: [PATCH] Update checklist.py --- modules/checklist.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/checklist.py b/modules/checklist.py index 8948bfe..3aef531 100644 --- a/modules/checklist.py +++ b/modules/checklist.py @@ -122,8 +122,16 @@ def list_checkin(): timeCheckedIn = "" checkin_list = "" for row in rows: - #calculate length of time checked in - timeCheckedIn = time.strftime("%H:%M:%S", time.gmtime(time.time() - time.mktime(time.strptime(row[2] + " " + row[3], "%Y-%m-%d %H:%M:%S")))) + # Calculate length of time checked in, including days + total_seconds = time.time() - time.mktime(time.strptime(row[2] + " " + row[3], "%Y-%m-%d %H:%M:%S")) + days = int(total_seconds // 86400) + hours = int((total_seconds % 86400) // 3600) + minutes = int((total_seconds % 3600) // 60) + seconds = int(total_seconds % 60) + if days > 0: + timeCheckedIn = f"{days}d {hours:02}:{minutes:02}:{seconds:02}" + else: + timeCheckedIn = f"{hours:02}:{minutes:02}:{seconds:02}" checkin_list += "ID: " + row[1] + " checked-In for " + timeCheckedIn if row[5] != "": checkin_list += "📝" + row[5]