Week of Year with Prefix: Template placeholder not Working

What I did:

I created a template that is supposed to have a title like this:

  • 'KW - ’

Here it is:

What happened:

The date placeholder isn’t recognized:

What I expected:

A title like this: KW26 - 2022

Things that might be helpful to know (Agenda version, OS and model, etc):

  • macOS Monterey 12.3.1
  • Agenda 14.1.1 App Store Version

Does it work if you leave a space between KW and \date?

Yes:

That’s what I figured, the \date requires to be at the start of a sentence or have a preceding space at the moment.

Yeah me, too. I thought maybe as a workaround I could just put the KW inside the formatting string, but it seems you can’t escape those. They always get interpreted.

That might be another bug.

Actually, that does work but instead of escaping like this, you should put things in a single colon. Now the pain here is that by default the textfield will turn single quotes into “smart quotes”, so you have to be sure to temporarily turn this off (Edit > Substitutions > Smart Quotes), you can then use the following syntax:

\date(format: 'KW'ww) or even \date(format: 'KW'ww '-' yyyy)

(btw note that you should always use yyyy instead of YYYY as the latter may give unexpected results on certain dates)

2 Likes

Great. That works! Thanks.

One more thing (two half things, really), though: I’m not sure I saw how to escape using single quotes in the docs.

Maybe it would be a good idea to have a “paste as plain text” option? Or deactivate smart quotes in the template window by default? Or also mention this quirk in the aforementioned docs when talking about escaping characters?

Just trying to think whalt would make this more frictionless for fellow users. :slight_smile: