The solution is right, but you need to adapt it for your use case.
First, there is one question that I need to ask if you want to check for that user if he has any record for that input date and time.
If yes, you will need to check that by creating a server action, using an aggregate you will filter by the user date. And you will check for the attribute date and time if is equal to the input that the user inserted.
Example:
1- Create an action for the on change event on the input
2- Creat Server action

3-Push the entity

4 Put the filters on the aggregate

5- Creat an output to say if the aggreta is empty or not with the filters


6-Push the server action to the client action from the on change event on the input

7-And pass the values to the inputs of the server action

8- And pass the validation message saying that there is already the same date-time

And with this logic it will return a message

And if you want to clean the variable don't forget about putting this assign
Check the OML