refactor date displaying