Check if two date objects are within a specific range

def date_in_range(date1, date2, range):
    """Check if two date objects are within a specific range"""
    date_obj1 = convert_date(date1)
    date_obj2 = convert_date(date2)
    return (date_obj2 - date_obj1).days <= range