Abu Dawud Book 2, Hadith Number 1226.
Chapter : When should a traveller observe complete prayer.
Narated By Abdullah ibn Abbas : The Apostle of Allah (PBUH) had a stop of seventeen days in Mecca and he shortened the prayer (i.e. prayed two rak’ahs at each time of prayer). Ibn Abbas said: He who stays seventeen days should shorten the prayer; and who stays more than that should offer complete prayer.