def date_message(n_clicks, freq, start_date, end_date):
    """

    Function that returns a message when the user enters a date range.

    Args:
        n_clicks: Number of clicks registered by the submit button.
        freq: Radio option for selecting the requests per day, hour, minute.
        start_date: Start date for the historical analysis.
        end_date: End date for the historical analysis.

    Returns:
        A message to the user as a response to the inputs for the historical
        analysis.

    """

    if start_date is None or end_date is None:
        return 'Please enter the date range'
    elif freq == 'Hour' or freq == 'Minute':
        start = int(start_date.split('-')[2])
        end = int(end_date.split('-')[2])
        if (end - start) == 1:
            return 'Data from {} to {}'.format(start_date, end_date)
        else:
            return 'For hours or minutes please enter two consecutive days'
    elif freq == 'Day':
        start = int(start_date.split('-')[1])
        end = int(end_date.split('-')[1])
        if (end - start) == 0:
            return 'Data from {} to {}'.format(start_date, end_date)
        else:
            return 'For days please enter a range within the same month'
    else:
        return 'Data from {} to {}'.format(start_date, end_date)