diff --git a/app/workingHours.py b/app/workingHours.py index 509e72c..6c3840e 100644 --- a/app/workingHours.py +++ b/app/workingHours.py @@ -2,25 +2,32 @@ from datetime import time, datetime, timedelta def is_working_hours(date = datetime.now()): if date.weekday() >= 5: + print("Its the weekend") return False start = time(8, 0, 0) end = time(18, 0, 0) current_time = date.time() + print(f"Current {current_time}") return start <= current_time <= end def potential_midday_upload(date = datetime.now()): if date.weekday() >= 5: + print("Its the weekend") return False midday_upload_time = time(14, 0, 0) current_time = date.time() + + print(f"Current {current_time} : {midday_upload_time}") + return midday_upload_time <= current_time def next_working_hour(date = datetime.now()): if is_working_hours(date): + print("Its already working hour") return date potential_start = date.replace(hour=8, minute=0, second=0, microsecond=0)