I'm applying a function to map a calculation over a list of dates. In the old calculation I just manually entered each date and ran the code. As part of if that code I would use
.get('year).getInfo() to obtain the year from a manually entered data.
var startDate = ee.Date('2016-10-01'); var endDate = ee.Date(startDate.advance(1,'month')); var startyear = startDate.get('year').getInfo(); var endyear = startDate.get('year').getInfo();
I've tried do this again within my function
var start = ee.Date(date); var end = ee.Date(date).advance(1,'month'); var date_range = ee.DateRange(start,end); var startyear = start.get('year').getInfo(); var endyear = start.start.get('year').getInfo();
But I'm getting the error
Unknown variable references: .
I'm guessing it's got something to do with the
.getInfo function and client vs server side. However, to obtain year as an object for use, I need to use
.getInfo to obtain it. Does anyone know any work arounds?
The link to my code is here