A reminder because of the recent heat wave in a large part of the country, we get bombarded all the time on radio and TV not to leave your kids, grandma and dogs in the car in the sun, while this is very good advice, it doesen't go far enough.
Don't leave your hat locked up in the sun in a closed vehicle either.Just this weekend alone I saw and fixed 5 severly damaged hats that had been left locked up in vehicles by their owners. I was able to save all 5 of them, but I have seen hats that could not be saved. It's a hard task to have to tell someone that they killed their hat by carelessness.
If you have no choice but to leave it, then put the hat out of direct sun, and even cover it with a light colored cloth to keep the sun rays from heating it up and warping it. But i fail to see any reason to not wear the hat when leaving the vehicle. If it's cool enough for you, the hat will be fine. And of course any place you can't wear a hat ain't worth going to anyway.