Yahya ibn Abi Ishaq relates from Anas (may Allah be pleased with him): “We traveled with the Prophet ﷺ from Medina to Mecca, and he prayed two-rakʿah units throughout the journey until we returned to Medina. I asked, ‘Did you stay in Mecca for any length of time?’ He replied, ‘We stayed there for ten days.’” In another wording preserved by Muslim it is stated, “How long did he remain in Mecca?” He answered, “Ten days.” Muslim also records a version that begins: “We set out from Medina for the pilgrimage….” (1)
This report of Anas does not contradict the narration of Ibn ʿAbbas: “The Messenger of Allah ﷺ stayed for nineteen days shortening the prayer; so when we travel for nineteen days we shorten, and if we stay longer we complete.” (2) Ibn ʿAbbas’s report refers to the Conquest of Mecca, whereas Anas’s concerns the Farewell Pilgrimage. The Prophet ﷺ and his Companions arrived at dawn on the fourth of Dhu’l-Hijjah, and there is no doubt that he ﷺ departed from Mecca at dawn on the fourteenth; thus his stay in Mecca and its environs during the Farewell Pilgrimage amounted to ten days.