add accumulation of captured time

This commit is contained in:
2025-11-13 19:04:55 +01:00
parent a54b19b938
commit 0e48ce265c
5 changed files with 26 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/python3
from util.str_to_datetime import datetime
from util.str_to_datetime import str_to_datetime as datetime
from model.TimeSlotContainer import time_slot_container as tsc
from model.TimeSlot import TimeSlot
@@ -35,3 +35,7 @@ if __name__ == "__main__":
elif args.command == "add":
tsc.add_time_slot(args.name, datetime(args.start), datetime(args.end))
elif args.command == "acc":
d = tsc.accumulate_duration(args.query)
print(f"{d.seconds // 3600}:{d.seconds % 3600 // 60}")