Near the summer solstice, it may happen that dusk occurs before dawn on the same day.
The twilight restriction did not take this situation into account, and was unable to shift restricted jobs to the next dusk.
This change shifts dusk to the next day when it happens before dawn on the same day, resolving this issue when evaluating jobs.
This change also fixes the accompanying exception on dark sky score occurring when debugging in that situation, as the job was occuring during daytime.