She woke up and found that her period had ended, but she did not know when it ended; is her fast valid?
Question

In Ramadan, an hour before Fajr, my period had still not ended. Then I went to sleep, and woke up before Zuhr. When I went to check whether my period had ended, the piece of cotton came out clean. Please note that I also put on a pad after I found that my period had not yet ended before Fajr, and the pad that I had put on was completely clean and remained clean until the time I woke up. Did my period end before Fajr, from the last time I saw blood, or was it when I saw that the pad was dry? Do I have to refrain from eating and drinking that day, or may I not fast?
Praise be to Allah.Firstly:
If a woman sees menstrual blood one hour before Fajr, then goes to sleep, and sees that her period has ended after that, but she is not sure when it ended – was it before Fajr or after? – then in principle she should assume that her period ended after Fajr.
That is because the principle is that the event should be attributed to the closest time. This is one of the basic principles of jurisprudence (fiqh). What this means is that if there is a difference of opinion regarding the time when something happened and there is no proof to define when it happened, then this event should be attributed to the closest time to the event, because that is what is certain and the more distant time is uncertain."(Mawsu‘ah al-Qawa‘id al-Fiqhiyyah, by Dr. Muhammad Sidqi al-Burno  12/316).
Please see also the answer to question no. 191684 .
Moreover, the condition of the fast being valid is ascertaining that the period had ended before Fajr, so it is not valid to fast when there is uncertainty about that.
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) was asked about a woman who fasted when she was uncertain as to whether her period had ended, then when she woke up she saw that it had indeed ended. Is her fast valid when she was not certain that her period had ended?
He replied:… With regard to the woman mentioned, her fast is not valid and she has to make up that day. That is because the basic principle is that she was still menstruating and her starting to fast when she was not certain that her period had ended means that she started to do an act of worship when she was not certain about one of the conditions of it being valid, and this means that it was not valid."(Majmu‘ Fatawa ash-Shaykh Ibn ‘Uthaymin  19/107).
Based on that, your fast on that day was not valid, and you have to make it up.
Secondly:
If a woman’s period ends during the day, does she have to refrain from eating and drinking and other things that invalidate the fast for the rest of the day, out of respect for the holy month?
There was a difference of opinion among the jurists regarding that, and there are two views.
The view that is more likely to be correct is that of the Malikis and Shafa‘is, which is that it is not obligatory for her to refrain from eating and drinking. This is the view that was favoured by Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) in ash-Sharh al-Mumti‘ (6/344).
It says in al-Mawsu‘ah al-Fiqhiyyah (18/318): There is no difference of opinion among the jurists that if the menstrual blood ceases after Fajr, then it is not valid for the woman to fast that day, and she has to make it up.
In that case, she must refrain from eating and drinking at that time, according to the Hanafis and Hanbalis.
According to the Malikis it is permissible for her to continue doing that which breaks the fast (eating and drinking), and it is not required for her to abstain.
According to the Shafa‘is, she is not obliged to refrain from eating and drinking. End quote.
Please see the answers to questions no. 65635 and 68829 .
And Allah knows best.