. ... And for those who are pregnant (whether they are divorced or their husbands are dead), their Idda (prescribed period) is until they lay down their burdens, and whoever keeps his duty to Allah and fears Him, He will make his matter easy for him. (V.65:4)

Hadith Number 4908

setting

Narrated Salim

That `Abdullah bin `Umar told him that he had divorced his wife while she was in her menses so `Umar informed Allah's Messenger (ﷺ) of that. Allah's Messenger (ﷺ) became very angry at that and said, "(Ibn `Umar must return her to his house and keep her as his wife till she becomes clean and then menstruates and becomes clean again, whereupon, if he wishes to divorce her, he may do so while she is still clean and before having any sexual relations with her, for that is the legally prescribed period for divorce as Allah has ordered."

Hadith Number 4909

setting

Narrated Abu Salama

A man came to Ibn `Abbas while Abu Huraira was sitting with him and said, "Give me your verdict regarding a lady who delivered a baby forty days after the death of her husband." Ibn `Abbas said, "This indicates the end of one of the two prescribed periods." I said "For those who are pregnant, their prescribed period is until they deliver their burdens." Abu Huraira said, I agree with my cousin (Abu Salama)." Then Ibn `Abbas sent his slave, Kuraib to Um Salama to ask her (regarding this matter). She replied. "The husband of Subai'a al Aslamiya was killed while she was pregnant, and she delivered a baby forty days after his death. Then her hand was asked in marriage and Allah's Messenger (ﷺ) married her (to somebody). Abu As-Sanabil was one of those who asked for her hand in marriage".