A help with dates in the Templates plugin

Hi there,

I just started using the Templates plugin, and it's really great.

But, I don't get to add dates specifically in my "locale" format.

For example, the template has the custom varible:

data_pagamento: date

But when I use the template the date is inserted backwards (instead 14/02/2023, for example, as 2023-02-14).

Is there a way to correct this?

Thanks in advance for any help.

You could use {{#custom_datetime}}variables{{/custom_datetime}} to set the date to whatever format you wish.

See this post for a list of time/date-related variables.

{{#custom_datetime}}L{{/custom_datetime}} should add a locale formatted numerical date using leading zeros and with each element separated by slashes.

That's really great! Thank you very much!

But, I can't use that together with custom variables, right?

:question: I don't understand what you mean.

The Joplin basic custom time/date variables are date, time, datetime, bows, bowm and are enclosed in double curly brackets i.e. {{datetime}}. They display the date / time format as it is set in Joplin's settings. These cannot be used in {{#custom_datetime}} tags.

Sorry for have not expressed myself very well.

Well, I would like to use a custom variable (data_pagamento: date), so I would be prompted to enter the date when adding the template. But I would like to make this presents the date in the format DD/MM/YYYY, and not YYYY/MM/DD as it is doing now.

For example, 25/01/2023 instead 2023/01/25.

Do you know if is that possible?

Thanks again.

I see! Sorry, it seems that I was referring to something different :man_facepalming:

The {{#custom_datetime}} variables will set the date at the time the note is created only. Basically it is an alternative to the template plugin's "built in variables"

You are right, there does not appear to be a way to change the date format when using the template calendar dropdown / selection tool. Although my selection calendar shows the date as DD/MM/YYYY when I select it, it creates the date in the note in ISO format YYYY-MM-DD.

Just looked at the Plugin's GitHub page and it seems that an issue has been raised about this.

I see! Sorry, it seems that I was referring to something different

Don´t worry. :slight_smile:

Ah, I understood. Many thanks for your help. I'll read that page.

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