To fast during a war would put you at a massive disadvantage. Did Muslim armies make an exception for war?
You might enjoy these answers from u/CptBuck and u/omaxx which discuss almost this exact question.
https://www.reddit.com/r/AskHistorians/comments/8o0kmx/to_what_extend_did_the_ramadan_have_effect_on_the/