Allah's Messenger (ﷺ) forbade the sale of date fruits till they were ripe. Abu `Abdullah (Al-Bukhari) said, "That means till they were red (can be eaten).
Sahih al-Bukhari Book 34, Hadith 142