Or did they not do Ramadan in times of war? If not, how was that justified?
While this answer does not deal with the Ottoman experience of WW1 specifically, there are categories of people who are exempted from fasting during Ramadan. u/CptBuck explains in this answer on a thread about how troops may have been affected by Ramadan.