Anas bin Malik reported,

The Messenger of Allah ﷺ sprained his foot, so he secluded himself in an upper room of his, the steps of which were made from palm trunks, and he swore an oath to stay away from his wives for a month.His companions came to visit him, and he led them in prayer while sitting, while they remained standing. When the time for the next prayer came, he said to them, "Follow your imam. If he prays standing, then pray standing, and if he prays sitting, then pray sitting along with him."He came down after twenty-nine days. They said, "Messenger of Allah, you swore to stay away for a month."He replied, "The month is twenty-nine days."

Ahmad 13071

Sahih

حدثنا يزيد بن هارون أخبرنا حميد

عن أنس

أن رسول الله ﷺ انفكت قدمه فقعد في مشربة له درجتها من جذوع وآلى من نسائه شهرا فأتاه أصحابه يعودونه فصلى بهم قاعدا وهم قيام فلما حضرت الصلاة الأخرى قال لهم ائتموا بإمامكم فإذا صلى قائما فصلوا قياما وإن صلى قاعدا فصلوا معه قعودا قال ونزل في تسع وعشرين قالوا يا رسول الله إنك آليت شهرا قال الشهر تسع وعشرون

أحمد 13071صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 13071
Ahmad 13071