This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_dates_intersect(dt1_from, dt1_to, dt2_from, dt2_to): | |
"""Returns True if there is an intersection of datetime ranges.""" | |
first_condition = (dt1_from <= dt2_from <= dt1_to) | |
second_condition = (dt2_from <= dt1_from <= dt2_to) | |
return first_condition or second_condition |