refactor views for custom js, fixed datepicker