extracted date formating to page it occurs on; styling
made the js readable