By regulation they are not required to fast if traveling more than the distance covered by a camel in one day. The days lost must be made up at a later date.
I know plenty of guys who fast from a Middle Eastern sunrise to a European summer sunset. They fly a normal schedule and take pride in their ability to do so. Then there are the others who take the month as the greatest excuse in the world to do F.All.
As for praying in the cockpit, its a lot safer than going to the mosque at the aft of the passenger cabin.
Mutt.