I used to work for a Middle Eastern carrier for a number of years and this question came up frequently. Spoke to moderate, devout Muslims and they said that, as working pilots, they could eat during the normal fasting period if they were flying but were expected to make up for any days lost by fasting after Ramadan, if necessary.
Most sensible ones did not fast, there were always a few who did and on a twelve hour day, West bound, during European summer time they had to be watched, particularly if we were on minimum rest.