I'm working on a google earth engine app. In order to let it run without code changing, i need to specify a date range to filter an ImageCollection. The inicial date should be an arbitrary one, but the last date should be the "latest" available. It would be nice also if anybody knows how to open a dialogue to let the user specify the inicial date.
var app = function (image)
{
//NDVI
var ndvi = image.normalizedDifference(['B8', 'B4']);
image = image.addBands(ndvi.rename('NDVI'));
return image;
}
var OLI = ee.ImageCollection("COPERNICUS/S2")
.filterDate('2016-10-01','2019-01-29')
.filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than',10)
//.map aplica la funcion "app" definida previamente a la ImageCollection
.filterBounds(table)
.map(app);