The Prophet (ﷺ) used to send Abdullah ibn Rawahah (to Khaybar), and he would assess the amount of dates when they began to ripen before they were eaten (by the Jews). He would then give choice to the Jews that they have them (on their possession) by that assessment or could assign to them (Muslims) by that assignment, so that the (amount of) zakat could be calculated before the fruit became eatable and distributed (among the people).
“The Messenger of Allah (ﷺ) entered upon me, while `Ali was with him, and we had a cluster of unripe dates hanging.” She said: “The Messenger of Allah (ﷺ) began eating, and `Ali ate with him. The Messenger of Allah (ﷺ) said to `Ali: ‘Stop, stop, for you are still recovering.’ So `Ali sat and the Prophet (ﷺ) ate.” She said: “I made some chard and barley for them, so the Prophet (ﷺ) said: ‘O `Ali eat from this, for indeed it will be more suitable for you.” Another chain reports a similar narration.