Get an array of date values from dataset, and based on the values, filter a date array, to get the ones available

This error is not related to that part of the code, is where you are using it.

You can adapt it to a repeater easily, you have to loop through the data and fill the repeater.