The World Federation One Stop Fiqh

Ruling 1338

If a traveller happens to stay somewhere for thirty days – for example, throughout those thirty days he was unsure about going or staying – he must perform tamām prayers after thirty days have passed even if he stays there for a short time [after the thirty days].