def date_format(date_str):
    """Formats date to yyyy-mm-dd. Returns date as string"""

    # The day in row data is not supplied
    day = '01'
    split_date = date_str.split('/')
    # When month is not supplied
    if len(split_date) < 2:
        month, year = '01', split_date[0]
    else:
        month, year = split_date

    return f'{year}-{month}-{day}'