when did people wear hats