It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that I heard Abul Qasim (peace and blessings be upon him) saying: Fast upon sighting the moon, celebrate Eid upon sighting the moon, and if the moon is not visible and the sky is cloudy, then complete the count to thirty.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 9376