add setEndDate function into datepicker