fix datepicker and add functional