@@ -679,7 +679,7 @@ def _next_opening_time(self, other: datetime, sign: int=1) -> datetime:
679
679
other = other + sign * self .next_bday
680
680
hour , minute = earliest_start .hour , earliest_start .minute
681
681
else :
682
- # find earliest starting time later than or equal to current time
682
+ # find earliest starting time no earlier than current time
683
683
for st in self .start :
684
684
if other .time () <= st :
685
685
hour , minute = st .hour , st .minute
@@ -690,7 +690,7 @@ def _next_opening_time(self, other: datetime, sign: int=1) -> datetime:
690
690
other = other + sign * self .next_bday
691
691
hour , minute = latest_start .hour , latest_start .minute
692
692
else :
693
- # find latest starting time earlier than or equal to current time
693
+ # find latest starting time no later than current time
694
694
for st in reversed (self .start ):
695
695
if other .time () >= st :
696
696
hour , minute = st .hour , st .minute
@@ -717,7 +717,8 @@ def _prev_opening_time(self, other: datetime) -> datetime:
717
717
"""
718
718
return self ._next_opening_time (other , sign = - 1 )
719
719
720
- def _get_business_hours_by_sec (self , start : datetime , end : datetime ) -> int :
720
+ def _get_business_hours_by_sec (self , start : datetime , end : datetime
721
+ ) -> int :
721
722
"""
722
723
Return business hours in a day by seconds.
723
724
"""
@@ -783,7 +784,7 @@ def apply(self, other):
783
784
other .second , other .microsecond )
784
785
n = self .n
785
786
786
- # adjust other to reduce cases to handle
787
+ # adjust other to reduce number of cases to handle
787
788
if n >= 0 :
788
789
if (other .time () in self .end or
789
790
not self ._onOffset (other )):
@@ -835,7 +836,8 @@ def apply(self, other):
835
836
while bhour_remain != timedelta (0 ):
836
837
# business hour left in this business time interval
837
838
bhour = self ._next_opening_time (other ) - other
838
- if bhour_remain > bhour or bhour_remain == bhour and nanosecond != 0 :
839
+ if (bhour_remain > bhour or
840
+ bhour_remain == bhour and nanosecond != 0 ):
839
841
# finish adjusting if possible
840
842
other += bhour_remain
841
843
bhour_remain = timedelta (0 )
0 commit comments