From Sahih Muslim (Hadith 3877):
Abu Huraira (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying:Do not buy the fruit until their condition is clear, and do not buy the fresh dates. A hadith like this has been reported by Ibn 'Umar through another chain of transmitters
Reference: Muslim 3877