Narrated Abu Malik:
from Al-Bara (regarding): And do not aim at that which is bad to spend from it (2:267) - he said: It was revealed about us, the people of the Ansar who were date-palm owners. A man would bring the amount of dates that he would from his date-palms, either a lot or a little. A man would bring a cluster or two and hang it in the Masjid. The people of As-Suffah did not have food, so one of them would go up to the cluster and hit it with his stick, and unripe and ripe dates would fall, and he would eat. Some people did not hope for good, so a man would bring a cluster with pitless and hard dates, and a cluster with damaged dates, and hang it. So Allah, Blessed and Most High, revealed: O you who believe! Spend of the good things which you have earned, and of that which We have produced from the earth for you, and do not aim at that which is bad to spend from it (2:267). They said: 'If one of you were given similar to what he gave, he would take it except bashfully with your eyes closed.' So after that, one of us would bring the best that we had.