So you have your selected dates list right?
you will use a list filter or list index,
for the list filter, if the list filter returns data
it means it exists and you return the output that exists if it doesn't exist
you return it doesn't exist. It is as simple as that. This will be used in
a client function inside of the properties of the button
I am going to create a quick example.
Have you read all the other answers? no questions?
Have a look at the OML
The other way as a solution would be using the approach from @Vikas Sharma, we need to give credit as well ;) and I think it would be a better approach if we knew how are you developing.
Here in this function, you can see it is comparing if the datetime from the button is inside of the selected list

And on the button, I am using the function

Note: I am using static data you just need to adapt the logic... also, you cannot use list filter or list indexes inside of functions, so I had to use a for each.
Kind regards,
Márcio