Bara bin Azib reported,

Regarding the verse "And do not aim toward the defective of it, spending from that" [Baqarah 2:267], he said, "This was revealed concerning us, the company of the Ansar. We were owners of date-palms, and a man would bring from his palms according to how much or how little he had. A man would bring a cluster or two of dates and hang it in the mosque. The people of the Suffah had no food, so when one of them grew hungry, he would come to the cluster and strike it with his staff, causing unripe and ripe dates to fall, and he would eat them.But there were people who had no desire for good, and one of them would bring a cluster containing shriveled and rotten dates, or a broken cluster, and hang it up. So Allah, blessed and exalted, revealed "You who believe, spend from the good things you have earned and from what We have brought forth for you from the earth. And do not aim toward the defective of it, spending from that when you yourselves would not take it except with closed eyes" [Baqarah 2:267]."He said, "If something like what one of you had given were offered to him as a gift, he would not accept it except by overlooking its faults or out of embarrassment."He said, "After that, each of us would bring the best of what he had."

Tirmidhi 2987

Sahih

حدثنا عبد الله بن عبد الرحمن أخبرنا عبيد الله بن موسى عن إسرائيل عن السدي عن أبي مالك

عن البراء

{ولا تيمموا الخبيث منه تنفقون} قال نزلت فينا معشر الأنصار كنا أصحاب نخل فكان الرجل يأتي من نخله على قدر كثرته وقلته وكان الرجل يأتي بالقنو والقنوين فيعلقه في المسجد وكان أهل الصفة ليس لهم طعام فكان أحدهم إذا جاع أتى القنو فضربه بعصاه فيسقط من البسر والتمر فيأكل وكان ناس ممن لا يرغب في الخير يأتي الرجل بالقنو فيه الشيص والحشف وبالقنو قد انكسر فيعلقه فأنزل الله تبارك تعالى {يا أيها الذين آمنوا أنفقوا من طيبات ما كسبتم ومما أخرجنا لكم من الأرض ولا تيمموا الخبيث منه تنفقون ولستم بآخذيه إلا أن تغمضوا فيه} قال لو أن أحدكم أهدي إليه مثل ما أعطاه لم يأخذه إلا على إغماض أو حياء قال فكنا بعد ذلك يأتي أحدنا بصالح ما عنده

الترمذي 2987صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tafsir of the Quran
Chapter
From Surah Baqarah
Numbering
Darussalam 2987
Tirmidhi 2987