def enhance_intraday_data(df):
    """Add columns to the intraday dataframe.

    Parameters
    ----------
    df : pandas.DataFrame
        The intraday dataframe.

    Returns
    -------
    df : pandas.DataFrame
        The dataframe with bar number and end-of-day columns.

    """
    df['date'] = df.index.strftime('%Y-%m-%d')
    date_group = df.groupby('date')
    df['bar_number'] = date_group.cumcount()
    df['end_of_day'] = False
    df.loc[date_group.tail(1).index, 'end_of_day'] = True
    del df['date']
    return df
