I've just been answering a beorg question on whether it's possible to insert the current day of the year via a template macro.
The answer is yes - but it's not straightforward. My answer combined both Scheme and JavaScript - see https://appsonthemove.freshdesk.com/support/discussions/topics/14000019782 if you'd like to see how I did this.