Update main.js

removed global method "formatDate" from the window and added to angular rootScope in app.js