Code cleanup
Changed date fields to date type
Make datepicker available in popups