[Machine] One of our scholars, from the followers of the people of Madinah, said: "If a person loses consciousness and then wakes up during the time of a prayer, they should pray it. Similarly, if they lose consciousness while fasting and then wake up before sunset, they should complete their fast. And if a person loses consciousness and wakes up before sunrise, they should pray Maghrib and Isha. They also said that if a menstruating woman becomes pure before sunset or before sunrise, she should pray the prayers she missed. This ruling is supported by a weakly transmitted Hadith." And Allah knows best.
كَانَ مَنْ أَدْرَكْتُ مِنْ فُقَهَائِنَا الَّذِينَ يُنْتَهَى إِلَى قَوْلِهِمْ يَعْنِي مِنْ تَابِعِي أَهْلِ الْمَدِينَةِ يَقُولُونَ فَذَكَرَ أَحْكَامًا وَفِيهَا الْمُغْمَى عَلَيْهِ لَا يَقْضِي الصَّلَاةَ إِلَّا أَنْ يُفِيقَ وَهُوَ فِي وَقْتِ صَلَاةٍ فَلْيُصَلِّهَا وَهُوَ يَقْضِي الصَّوْمَ وَالَّذِي يُغْمَى عَلَيْهِ فَيُفِيقُ قَبْلَ غُرُوبِ الشَّمْسِ يُصَلِّي الظُّهْرَ وَالْعَصْرَ وَإِنْ أَفَاقَ قَبْلَ طُلُوعِ الْفَجْرِ صَلَّى الْمَغْرِبَ وَالْعِشَاءَ قَالُوا وَكَذَلِكَ تَفْعَلُ الْحَائِضُ إِذَا طَهُرَتْ قَبْلَ غُرُوبِ الشَّمْسِ أَوْ طُلُوعِ الْفَجْرِ وَرُوِيَ فِيهِ حَدِيثٌ مُسْنَدٌ فِي إِسْنَادِهِ ضَعْفٌ وَاللهُ أَعْلَمُ