Formatting dates and prepare table view