refactor dateDialog and timeDialog