What can I do to treat swollen, red, painful hard palate that's been hurting for over a week? Should I avoid food? Can I put calendula ointment on it?

Visit your doctor. Swelling and pain of palate may be due to many reasons like trauma, allergy, irritants, infection, etc. Treatments vary depending on the underlying condition. If the symptoms persist more than 10 days, please visit your dentist or doctor for evaluation.
My advice. Since we can't know what's causing the problem over the internet, we really can't give you good advice other that to see your dentist to determine the exact cause of the problem and then render appropriate treatment if necessary. While it might go away on its own, since it has been present for over a week, you really should see a dentist.
See the Oral Surgeon. All depends on what caused the condition. If it is a burn or a scrape, time and the proper care will usually be enough. Warm salt water rinses 3-5 times/day for 5-7 days. Very soft diet -- soups, pudding, applesauce, mashed potatoes, eggs, pancakes, smoothies (with a spoon , only)etc. No hard, chewy, sticky, crusty or spicy foods. No remotely hot fluids. No ointment, except maybe orabase. See dr.
Trauma. Sometimes crusty bread or another hard sharp food can cause this. Traumatic cuts or ulcers are common in this area. Try over the counter kanka to coat and soothe. After 7-10 date if things don't improve, see your dentist!