As for anyone who breaks the fast because of an excuse that will pass—such as a traveller, a sick person whose recovery is expected, a pregnant woman or a nursing mother who fears for herself or for her child, or a woman in menstruation or post-partum bleeding—each of them is unquestionably obliged to make up the missed days by fasting an equal number later. The Almighty says: “And whoever is ill or on a journey, then [let him fast] a number of other days” (Q 2:185).
For a sick person whose fasting would harm him, and for a traveller who is permitted to shorten the prayer, it is Sunnah to break the fast. Concerning them Allah says: “then [let him fast] a number of other days” (Q 2:185); that is, he should break the fast now and make up the same number later. Allah also says: “Allah intends ease for you and does not intend hardship for you” (Q 2:185). The Prophet ﷺ was never given a choice between two options without choosing the easier of the two, and in the two Ṣaḥīḥs it is narrated: “It is not an act of piety to fast while travelling.”
If, nevertheless, the traveller or the sick person for whom fasting is difficult chooses to fast, the fast is valid though disliked. As for a woman who is menstruating or experiencing post-partum bleeding, fasting in that state is prohibited and invalid.
A nursing mother or a pregnant woman is likewise required to make up the days she has missed,