refactor code in order to display proper values per day (todo: fix the comparison between dates)