The Messenger of Allah ﷺ forbade the sale of fruits for dried dates, but gave license regarding the 'araya for its sale on the basis of a calculation of their amount. But those who buy them can eat them when fresh. (Using translation from Abū Dāʾūd 3363)
أَنَّ رَسُولَ اللَّهِ ﷺ «نَهَى عَنْ بَيْعِ الثَّمَرِ بِالثَّمَرِ وَرَخَّصَ فِي الْعَرِيَّةِ أَنْ تُبَاعَ بِخَرْصِهَا وَالْعَرِيَّةُ أَنْ يَأْكُلَهَا أَهْلُهَا رُطَبًا»