Sayyiduna Salamah bin al-Akwa' (may Allah be pleased with him) narrates: In the time of the Messenger of Allah (peace and blessings be upon him), (regarding) the fasts of Ramadan, whoever among us wished would fast and whoever wished would not fast and would give the ransom of feeding a poor person, until this verse was revealed: "So whoever of you witnesses the month, let him fast it" [Surah al-Baqarah: 185].
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصيام / 7896