I want to build a dynamic html select element that includes the prior five years, given the current year. So, since it is now 2020, the result would be:
<select>
<option value="2015">2015</option>
.
.
<option value="2019">2019</option>
Basically want a "loop while" function, but Twig does not do that. I know I did something like this once before with a macro, but can't for the life of me remember and can't find anything on Stack Exchange.
I know I could do it with Javascript, but would prefer to use Twig. Have the feeling I am missing something obvious, just not obvious to me!