Wow, that’s incredibly neat! I was hoping for exactly something like this! Thanks a lot!
For the record: In the meantime, I experimented with an ugly workaround based on this idea by creating data/weekdays.yml
in my themes folder, containing
Monday: 1
Tuesday: 2
Wednesday: 3
Thursday: 4
Friday: 5
Saturday: 6
Sunday: 7
Afterwards, it was possible to get the weekday as an int
by something like this:
index $.Site.Data.weekday (string now.Weekday)
But I’d rather not convert the integer weekday to an english language string just to map it back to an integer, that seems inefficient and error-prone. So I like @jmooring’s idea a lot better!