Aliases metadata is not getting populated using {{date}} and {{time}} variables

What I’m trying to do

I am have created a template with following front matter. I expect that on inserting this template the fields created and aliases should get populated.

The created field gets populated correctly, however aliases is coming up as

aliases: []

front matter=>

created: {{date:YYYYMMDD}}{{time:HHmmss}}
aliases: 
  - {{date:YYYYMMDD}}{{time:HHmmss}}
  - {{date:YYYYMMDD}}.{{time:HHmmss}}

Things I have tried

I created a nested metadata field, and it gets populated properly

id:
  - timeID: {{date}}{{time}}

I copy pasted from created field, just to check if there were spelling errors
I tried both {{date}} and {{date:YYYYMMDD}} format

The date format is set to YYYYMMDD and time to HHmmss in Templates plugin properties.

I can’t figure out why aliases field isn’t getting populated properly.

I have no idea why :sweat_smile: … but this seems to be working :blush: :

created: {{date:YYYYMMDD}}{{time:HHmmss}}
aliases:
- "{{date:YYYYMMDD}}{{time:HHmmss}}"
- "{{date:YYYYMMDD}}.{{time:HHmmss}}"

And if you already set up the default date format as YYYYMMDD and the default time format as HHmmss in the core Template plugin settings, I don’t even think you need to precise the format of the date & time here …

I mean, this :

created: {{date}}{{time}}
aliases:
- "{{date}}{{time}}"
- "{{date}}.{{time}}"

should give you the same result, I think :thinking:

Thanks, it works now.

However if I were to use following:

aliases: 
  - "{{date}}{{time}}"
  - "{{date}}.{{time}}"
  - "{{date}} {{time}}"

I get

aliases:
  - "20230905202633"
  - "20230905.202633"
  - 20230905 202633

why the first two end up in quotes and not the third one. Or if the third is the expected output from template then why first should have quotes.

Is there a bug here?

The first 2 end up in quotes to explicitly mark them as text strings instead of numbers. The third one doesn’t need that because it contains a space.

That makes sense :smile: !
Thank you :grin: !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.