Updated views and code for datepicker functionality