def ndvi_filter_date(image_directory):
    
    """A function that extracts the date of image collection from the imagery path name

    Parameters
    ----------
    directory: directory to file including study 
    site e.g: "'HARV/landsat-crop/LC080130302017031701T1-SC20181023151837'"
    
    Returns
    -------
    Date string of the image directory

    """
    filter_path = image_directory
    filter_year = filter_path[28:32]
    filter_month = filter_path[32:34]
    filter_day = filter_path[34:36]

    filter_date = filter_year + "-" + filter_month + "-" + filter_day

    return filter_date