def date_to_time_period(date):
    """
    Converts part of a date to what xlabel that would be.

    Parameters
    ----------
    date : string
        eg 2020-10.

    Returns
    -------
    str
        The time period the partial date represents.

    """
    if len(date) == 0:
        return "all time"
    else:
        return date