Question: With regard to supererogatory Sawm (Fast), one may have the intention to observe Sawm on a particular day but when they get up in the morning, they find themselves in a state of Janaabah (major ritual impurity related to sexual discharge). What is the ruling on this matter? Should they complete the Sawm?
Answer: If one observes Sawm at the time when abstention from all that breaks Sawm is due, while they are in a state of Janaabah, their Sawm is valid. This ruling is based on the Hadeeth related by Al-Bukhaaree and Muslim on the authority of Umm Salamah (may Allaah be pleased with her) that she said... read more here.