from datetime import datetime


def controls_dates(control):
    """Get the control start and end dates
    Parameters
    ----------
    control : dict
        A control "object"
    Returns
    -------
    start, end : datetime.date
        Will return None if no dates set
    """
    def date(str_date):
        return datetime.strptime(str_date, '%m/%d/%Y').date()
    try:
        start = control['dates']['start']
        end = control['dates']['end']
        return date(start), date(end)
    except:
        return None, None