When the Messenger of Allah ﷺ arrived in Medina, the people were paying in advance for dates one, two, and three years ahead. The Messenger of Allah ﷺ said, "Whoever pays in advance for dates must do so for a specified measure, a specified weight, and a specified term."
حدثنا عبد الله بن محمد النفيلي حدثنا سفيان عن ابن أبي نجيح عن عبد الله بن كثير عن أبي المنهال
قدم رسول الله ﷺ المدينة وهم يسلفون في التمر السنة والسنتين والثلاثة فقال رسول الله ﷺ من أسلف في تمر فليسلف في كيل معلوم ووزن معلوم إلى أجل معلوم
Bukhari narrated it in the Book of Salam, Chapter on advance payment for a known weight, hadith no. 2240, and Muslim in the Book of Musaqah, Chapter on salam, hadith no. 1604, from the hadith of Sufyan, through him.