Put the vinegar, sugar, and wine into a small saucepan and cook over moderate heat, stirring until the sugar dissolves. Add the onions and apples and cook until the onions are translucent, about 15 minutes.
Remove the pan from the heat, then stir in the figs, dates, pistachios, and ground spices. Set aside to let cool before serving.
Photo: Ditte Isager