1. Butter a 9-inch (23cm) loaf pan and line the bottom with parchment paper. Preheat the oven to 350ºF (180ºC).
2. To make the cake, toss the date pieces in a small bowl with the rum or whiskey and set aside.
3. In a medium bowl, whisk together the flour, baking soda, cinnamon, ginger, allspice or cloves, and salt.
4. In the bowl of a stand mixer fitted with the paddle attachment, or by hand in a large bowl with a study spatula, cream the butter with the granulated and brown sugar at medium high speed until smooth. Beat in the egg.
5. By hand, stir in half of the dry ingredients, add the applesauce and vanilla, and stir in the remaining dry ingredients so they are partially mixed in. Fold in the dates (and any liquid in the bowl, if there is any) and mix just until the dry ingredients are incorporated and the dates are evenly dispersed. Do not overmix or the cake will be tough.
6. Scrape the batter into the prepared loaf pan and smooth the top. Bake until a toothpick inserted into the center comes out clean, about 1 hour. Remove from oven and let cool completely before glazing.
7. To make the glaze, heat the sugar and water in a medium-sized saucepan (about 4qts/4l) with a few drops of lemon juice. Cook until the sugar turns deep amber brown and starts to smoke, tilting the pan gently as the sugar cooks. (Check the post on making the perfect caramel.)
8. Remove from heat and stir in the butter until melted, then stir in the heavy cream, salt and vanilla until smooth. Let cool until it’s just above room temperature, still slightly warm, so it reaches a spreadable consistency. Remove the cake from the pan and spoon the glaze over the cake. If desired, sprinkle a few grains of flaky salt over the top of the cake.