Step 1Stir the sugar and yeast into a small bowl filled with 1 cup of lukewarm water. Set aside until foamy, about 10 minutes.
Step 2Meanwhile, in a large bowl, whisk together the flours, salt, cardamom and cinnamon, if using. Form a well in the center of the dry ingredients and pour in the yeast mixture with 2 tablespoons oil. Stir, gently working the flour into the middle, until a shaggy dough forms.
Step 3Turn the dough out onto a floured surface and knead until smooth and elastic, about 5 minutes. Sprinkle the dates over dough in two batches and continue kneading until they're well combined, 2 to 3 more minutes. Coat the inside of a large bowl with 1 teaspoon of the remaining oil, then transfer the dough to the bowl. Loosely cover the bowl with a damp towel or plastic wrap, and set aside in a very warm spot until the dough has doubled in size, about 1 1/2 hours.
Step 4Lightly oil 2 large baking sheets with 2 teaspoons oil. Divide the dough into two equal pieces and press and stretch each into an oval 14 inches long and 7 inches wide. Place the ovals on the baking sheets and brush with the remaining 2 tablespoons oil. Evenly scatter the onions on the top of each oval, then set aside in a very warm spot until they are soft and puffed in appearance, about 45 minutes.
Step 5Meanwhile, place the racks in the top and bottom third of the oven and heat to 400 degrees. Bake the flatbreads, rotating the trays halfway through for even coloring. Bake until cooked through and golden brown, 20 to 25 minutes. Slice into wedges and serve warm or at room temperature.