Moved logic to format date to view.