added functionality for selecting within dates