File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
aws_lambda_powertools/utilities/feature_flags Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,8 @@ def compare_time_range(action: str, values: Dict) -> bool:
49
49
start_hour , start_min = values .get (TimeValues .START .value , "" ).split (HOUR_MIN_SEPARATOR )
50
50
end_hour , end_min = values .get (TimeValues .END .value , "" ).split (HOUR_MIN_SEPARATOR )
51
51
52
- start_datetime = current_time .replace (hour = int (start_hour ), minute = int (start_min ))
53
- end_datetime = current_time .replace (hour = int (end_hour ), minute = int (end_min ))
52
+ start_time = current_time .replace (hour = int (start_hour ), minute = int (start_min ))
53
+ end_time = current_time .replace (hour = int (end_hour ), minute = int (end_min ))
54
54
55
55
if int (end_hour ) < int (start_hour ):
56
56
# When the end hour is smaller than start hour, it means we are crossing a day's boundary.
@@ -67,7 +67,7 @@ def compare_time_range(action: str, values: Dict) -> bool:
67
67
# └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
68
68
# │
69
69
70
- return (start_datetime <= current_time ) or (current_time <= end_datetime )
70
+ return (start_time <= current_time ) or (current_time <= end_time )
71
71
else :
72
72
# In normal circumstances, we need to assert **both** conditions
73
- return ( start_datetime <= current_time ) and ( current_time <= end_datetime )
73
+ return start_time <= current_time <= end_time
You can’t perform that action at this time.
0 commit comments