How can I create a dynamic date condition