Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bukhari:311Musaddad > Muʿtamir > Khālid > ʿIkrimah > ʿĀʾishah

One of the mothers of the faithful believers (i.e. the wives of the Prophet ﷺ ) did Iʿtikaf while she was having bleeding in between her periods.  

البخاري:٣١١حَدَّثَنَا مُسَدَّدٌ قَالَ حَدَّثَنَا مُعْتَمِرٌ عَنْ خَالِدٍ عَنْ عِكْرِمَةَ عَنْ عَائِشَةَ

أَنَّ بَعْضَ أُمَّهَاتِ الْمُؤْمِنِينَ اعْتَكَفَتْ وَهْىَ مُسْتَحَاضَةٌ