finished javascript and updated datepicker