بسم الله الرحمن الرحيم
When a menstruating woman or one with post natal bleeding returns to a state of purity before the setting of the sun, she is obliged to pray both dhuhr and asr of that day. Whoever returns to a state of purity before the appearance of the dawn, she is obliged to pray maghrib and ishaa of that night. This is because the time for the second prayer is the time for the first prayer (as well) when in a circumstance that necessitates an excuse (for the abandonment of the prayer).
Sheikh-ul-Islam Ibn Taimiyyah said: “The majority of the scholars state this, like Maalik, Ash-Shaafi’ee, and Ahmad. Whenever a menstruating woman regains purity at the last part of the day, she prays both dhuhr and asr. If she regains purity at the last end of the night she prays maghrib and ishaa, just as it was conveyed from Abdur Rahman ibn Auf, Abu Huraira, and Ibn Abbas. This is because the time between these two prayers are shared when in a circumstance that necessitates an excuse. Thus if she regains purity in the last part of the day the time for dhuhr still remains, hence she prays dhuhr before asr. If she regains purity at the end of the night the time for maghrib still remains in a circumstance that necessitates an excuse. Hence she prays maghrib before ishaa.”
Translated by Abu Abdil Waahid Najeeb Ibn Yusuf Al Anjelesi
Source: الملخص الفقهي