Sahih Muslim Book 6, Hadith Number 2548.

Chapter : Abrogation of the words of Allah: “And as for those who can fast (but do not) the expiation is” by the words: “Whosoever witnesses it he shall have to fast the whole month” (ii. 184).

Salama b. Akwa’ reported: We, during the lifetime of the Messenger of Allah (may peace be upon him), in one month of Ramadan (observed fast according to our liking). He who wished to fast lasted and he who wished to break broke it and fed a needy person as an expiation 1544 till this verse was revealed: “He who witnesses among you the month (of Ramadan) he should observe fast during it” (ii. 184).