feat: work shift pauses
This commit is contained in:
@@ -1,7 +1,13 @@
|
||||
from datetime import timedelta
|
||||
|
||||
from math import floor
|
||||
|
||||
|
||||
def hours_to_hours_and_minutes(hours: float) -> tuple[int, int]:
|
||||
def hours_to_hours_and_minutes(time: timedelta) -> tuple[int, int]:
|
||||
if time.total_seconds() < 60:
|
||||
return 0, 0
|
||||
|
||||
hours = time.total_seconds() / 3600
|
||||
res_hours = int(floor(hours))
|
||||
minutes = int(round((hours - res_hours) * 60))
|
||||
minutes = int(floor((hours - res_hours) * 60))
|
||||
return res_hours, minutes
|
||||
|
||||
Reference in New Issue
Block a user