Fasting on a doubtful day is forbidden
It is narrated from Ammar bin Yasir (may Allah be pleased with him) that:
من صام اليوم الذى يشك فيه فقد عصى أبا القاسم
“Whoever fasts on a doubtful day has disobeyed Abu al-Qasim ﷺ.”
[Bukhari (mu’allaq): before hadith 1906, Kitab al-Sawm: Bab idha ra’aytum al-hilal, Abu Dawud: 1334, Tirmidhi: 686, Nasa’i: 153/4, Ibn Majah: 1645, Darimi: 2/2, Daraqutni: 157/2]
The doubtful day means the thirtieth day of the month of Sha’ban, that is, when the moon is not sighted that night because of cloud cover and there is doubt as to whether it is Ramadan or not.
[Subul al-Salam: 861/2]
Or upon the completion of the days of the month of Sha’ban
➊ It is narrated from Abu Hurayrah (may Allah be pleased with him) that the Messenger of Allah ﷺ said: “Fast upon seeing the moon and break the fast upon seeing it, but if the moon is hidden because the horizon is cloudy, then:
فاكملو عدة شعبان ثلاثين
“complete the thirty days of Sha’ban.”
[Bukhari: 1909, Kitab al-Sawm: Bab qawl al-Nabi: idha ra’aytum al-hilal fasumu, Muslim: 1081, Nasa’i: 133/4, Ahmad: 415/2, Darimi: 3/2, Bayhaqi: 205/4]
If the moon of Shawwal is not sighted before thirty days, then thirty fasts should be completed
➊ It is narrated from Ibn Umar (may Allah be pleased with them both) that the Messenger of Allah ﷺ said: “When you see the moon, fast, and when you see the moon (of Eid), break the fast, but if the horizon is cloudy, then فاقدرواله “estimate it.” In one narration in Sahih Muslim it is: فاقدروا له ثلاثين “then estimate for it the count of thirty days.”
[Bukhari: 1906, Kitab al-Sawm: Bab qawl al-Nabi: idha ra’aytum al-hilal fasumu, Muslim: 1080, Ibn Majah: 1654]
➋ It is narrated from Ibn Abbas (may Allah be pleased with him) that the Messenger of Allah ﷺ said: “Do not fast one or two days before the month of Ramadan, unless one of you has been fasting regularly beforehand. And do not fast until you see the moon. Then fast until you see it (again). If a cloud comes between you and the moon,
فاكملو العدة ثلاثين ثم أفطروا
“then complete the count of thirty days and then break the fast.”
[Sahih: Sahih Abi Dawud: 2041, Kitab al-Sawm: Bab man qala fa-in ghumma alaykum fasumu thalathin, Abu Dawud: 2327, Tirmidhi: 688, Nasa’i: 136/4, Ibn Abi Shaybah: 20/3]