I visited Morocco for 3 weeks in January of 1997. As it turned out this was during the Muslim month of Ramadan during which business hours, train and bus schedules, and visiting times for tourist sites are reduced. Fortunately this meant that there were fewer tourists around. Unfortunately, it meant that I would not have time to visit every place I had hoped to.
During Ramadan Muslims are prohibited from allowing anything to pass between their lips from sunrise to sunset. So no eating, drinking, or smoking is allowed. This only applies to the local populace and no non-Muslim visitors are expected to adhere to these strictures. I was able to eat and drink in restaurants during daylight hours without attracting any notice.