Added logic for showing dates