The World Federation One Stop Fiqh

Ruling 1328

If a traveller who has made the intention to stay somewhere for ten days keeps a fast and after the time for ẓuhr prayers he changes his mind about staying there, in the event that he has performed a four rakʿah prayer, the fasts he keeps there are valid and he must perform tamām prayers. However, if he has not performed a four rakʿah prayer, he must, as an obligatory precaution, complete that day’s fast and also make it up; he must also perform qaṣr prayers and he cannot fast on the remaining days.