fixed chat

username, avatar and date formatting
moved date function to functions