Vitamin D is largely responsible for the proper mineralization of bone but also promotes the absorption of calcium, also a big contributor to the skeletal system. In the 19th century, studies were performed on patients with rickets and found that doses of cod liver oil, the best edible source of Vitamin D, were able to reverse the effects of the disease and in 1930 milk began to be fortified with it. With that, rickets, which was known for its telltale bone deformation, became as irrelevant to the modern world as scurvy.
Now don't get us wrong; we are in no way promoting gallivanting about in the sun all day- you don't need much exposure to get your fill and besides, sunburns and melanoma are serious reasons to refrain from such activities- nor are we defaming the name of sunscreen (in fact, sunscreen is the only "beauty" product which does prevent premature aging and it should be a part of everyone's daily toilette). But you remember how overuse of hand sanitizer bred super resilient bacteria, right?
If the infamous "they" are saying something, it's probably as fact based as a rumor. Do your research too. Don't forget "everything in moderation", protect yourself and especially kids who are more susceptible to sun damage, and absolutely do enjoy your time outdoors this summer.