Lowercase month in template

What I’m trying to do

I want to have a filename created in a template to use a lowercase 3-letter month (eg, mar14) rather that an uppercase month (eg, Mar14).

Things I have tried

This is the template (via Templater) as the starting point:
# {{date:YYYYMMDD}} {{date:ddd [DOY=]DDDD [DOW=]ddd}} [[{{date:[q-]MMMDD}}]]

which produces:

20230314

Tue DOY=073 DOW=Tue [[q-Mar14]]


…it’s that last part MMMDD that produces Mar14. I have tried other variations (mmmDD) to no success.

I’ve also tried searching the forum (“lowercase month”, “lower case month”), and I’ve looked through the moment documentation at Moment.js | Docs .

Appreciate any tips.

If you switch to Templater execution command, you could append a string version of the date to lower case using myDateVar.toLowerCase().

I’m not able to give you an proper example, as I’m a little confused as to what your intended output is going to look like and why you have some many curly braces in your example. Is that Templater code or just the core template plugin code (or QuickAdd template code) ?

This is the intended output above.

So, this part {{date:YYYYMMDD}} produces the date via the core template (in the OP I said “via Templater” but that is not correct, as I think this is straight out of core). The portion after date: formats it without dashes.

{{date:ddd [DOY=]DDDD [DOW=]ddd}}:
Breaking this down…

  • this is the same as {{date}} in a template, where when running the template, it replaces {{date}} with today’s date.
  • by adding :ddd, it follows the moment.js formatting for dates (per the link to the Docs file in the original post)… 3 lower case d’s outputs a 3-letter capitalized day of the week (Mon). In my use case, I prefer mon.
  • prepending with bracketed text [DOY=]DDDD simply prepends the field with text, while DDDD is the momentjs format for the numerical day of the year.
  • [DOW=]ddd – I actually don’t need this here, because I already have it at the beginning of the line.

Anyway, that’s what the curly braces are all about.

I’ll try your myDateVar method, as it seems straightforward. Thanks, @holroy.