‘Abdallah b. ‘Umar said that God's Messenger forbade the sale of fruits till they were clearly in good condition, forbidding it both to the seller and to the buyer. A version by Muslim says he forbade selling palm-trees (i.e. their fruit) till the dates began to ripen, and ears of corn till they were white and were safe from blight.
(Bukhari and Muslim.)