implements date selection functionality