YukiGasai / obsidian-google-calendar

Add Google Calendar inside Obsidian
https://yukigasai.github.io/obsidian-google-calendar/
GNU General Public License v3.0
342 stars 24 forks source link

Placeholders and event note name format oddness #237

Open issaqua opened 6 months ago

issaqua commented 6 months ago

Hi guys,

If I use the following code in the event template:

await tp.file.move("/Events/" + window.moment('{{gEvent.start.date}}' != '' ? '{{gEvent.start.date}}' : '{{gEvent.start.dateTime}}').format('YYYYMMDD[T]HHmm') + " " + tp.file.title)

I can correctly rename the file to what I want. According to https://yukigasai.github.io/obsidian-google-calendar/Settings/Placeholders I should be able to do the following (faster) via the event note prefix, or the event note name format:

{{event-year}}{{event-month}}{{event-day}}T{{event-hour24}}{{date-minute}}

This fails, e.g. it gives a filename of:

20240115T{{event-hour24}}{{event-minute}}

Even if I leave out the "T" I get:

20240115{{event-hour24}}{{event-minute}}

Thanks!