def no_date_x_days_before_date_to_check(date_to_check, datelist, min_gap):
    """
    Returns true if datelist contains a date less than or equal to min_gap days before date_to_check. Checked. 
    Ignores dates that are greater than or equal to date_to_check. 
    """
    for previous_date in datelist:
        if previous_date >= date_to_check:
            continue
        if (date_to_check - previous_date).days <= min_gap:
            return False
    return True