added function for formating date and time. added ajaxaction to controller to save eventdata