File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -271,11 +271,8 @@ def create_orderround_batch():
271271 return []
272272
273273 # Adjust start date to the configured open day of the week
274- if start_date .weekday () < config .ORDERROUND_OPEN_DAY_OF_WEEK : # Ensure it starts on the configured day
275- start_date += timedelta (days = config .ORDERROUND_OPEN_DAY_OF_WEEK - start_date .weekday ())
276- elif start_date .weekday () > config .ORDERROUND_OPEN_DAY_OF_WEEK :
277- start_date -= timedelta (days = start_date .weekday () - config .ORDERROUND_OPEN_DAY_OF_WEEK )
278-
274+ days_until_target = (config .ORDERROUND_OPEN_DAY_OF_WEEK - start_date .weekday ()) % 7
275+ start_date += timedelta (days = days_until_target )
279276 # Calculate the end date for the next quarter
280277 # This will be the last day of the next quarter
281278 end_date = get_last_day_of_next_quarter ()
You can’t perform that action at this time.
0 commit comments