Datepicker was used in main.js without the jquery ui being loaded 

(killing js everywhere except on event edit page), this should fix it by checking the jquery ui is loaded before calling the pugin.