Fix exception while typing in date using keyboard input: take 2