Yahya related to me from Malik from Nafi from Sulayman ibn Yasarfrom Umm Salama, the wife of the Prophet ﷺ that a certain woman in the time of the Messenger of Allah ﷺ used to bleed profusely, so Umm Salama consulted the Messenger of Allah ﷺ for her, and he said, "She should calculate the number of nights and days a month that she used to menstruate before it started happening, and she should leave off from prayerfor that much of the month. When she has completed that she should do ghusl, bind her private parts with a cloth, and then pray."
عَنْ أُمِّ سَلَمَةَ زَوْجِ النَّبِيِّ ﷺ أَنَّ امْرَأَةً كَانَتْ تُهَرَاقُ الدِّمَاءَ فِي عَهْدِ رَسُولِ اللَّهِ ﷺ فَاسْتَفْتَتْ لَهَا أُمُّ سَلَمَةَ رَسُولَ اللَّهِ ﷺ فَقَالَ لِتَنْظُرْ إِلَى عَدَدِ اللَّيَالِي وَالأَيَّامِ الَّتِي كَانَتْ تَحِيضُهُنَّ مِنَ الشَّهْرِ قَبْلَ أَنْ يُصِيبَهَا الَّذِي أَصَابَهَا فَلْتَتْرُكِ الصَّلاَةَ قَدْرَ ذَلِكَ مِنَ الشَّهْرِ فَإِذَا خَلَّفَتْ ذَلِكَ فَلْتَغْتَسِلْ ثُمَّ لِتَسْتَثْفِرْ بِثَوْبٍ ثُمَّ لِتُصَلِّي