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

I forgot to reply to this, I only answered.
Below is the function.