def season(csv_name):
    """
    Function checks and creates a season date, is taking information from file name.
    :param csv_name: csv file name
    :return: season date (format: 2011-2012)
    """

    season_year = csv_name[0:4]

    if csv_name[-13:-11] == 'CH' or csv_name[-13:-11] == 'OL':
        season_date = season_year
    elif csv_name[5:7] in ["10", "11", "12"]:
        season_date = f"{season_year}-{int(season_year) + 1}"
    elif csv_name[5:7] in ["01", "02", "03", "04"]:
        season_date = f"{int(season_year) - 1}-{season_year}"
    else:
        season_date = season_year

    return season_date