coding datepicker and query