We observed itikaf with the Messenger of Allah ﷺ during the middle ten days of Ramadan. He said, "I was shown Laylat al-Qadr, but I was made to forget it, so seek it in the odd nights of the last ten."
حدثنا أبو بكر بن أبي شيبة حدثنا إسمعيل ابن علية عن هشام الدستوائي عن يحيى بن أبي كثير عن أبي سلمة
اعتكفنا مع رسول الله ﷺ العشر الأوسط من رمضان فقال إني أريت ليلة القدر فأنسيتها فالتمسوها في العشر الأواخر في الوتر
Bukhari narrated it in the chapter on the merit of Laylat al-Qadr, the section on seeking Laylat al-Qadr in the last seven nights, hadith 2016, and others, and Muslim in the book of fasting, the section on the merit of Laylat al-Qadr and the encouragement to seek it, and so on, hadith 216/1167, from the hadith of Hisham with the same wording, at greater length.