Update app.js

added global method to Format date for application use