If you define the data as an array, data.get(i) should be an object, not a string.Then eachDate.parse() need a string as parameter.