mProjectsCode / obsidian-media-db-plugin

A plugin that can query multiple APIs for movies, series, anime, games, music and wiki articles, and import them into your vault.
GNU General Public License v3.0
255 stars 31 forks source link

Using a template to get a timestamp gives an error #44

Closed ltctceplrm closed 2 years ago

ltctceplrm commented 2 years ago

Describe the bug When I try to timestamp the new media entries using the templates they give an error instead of the timestamp.

To Reproduce Steps to reproduce the behavior:

  1. Have this this template for movies created: {{ date:YYYY-MM-DDTHH:mm:ssZ }}
  2. Add a new media DB movie entry
  3. See error

    created: "{ INVALID TEMPLATE TAG }": null

Expected behavior For regular notes this template works fine and it should post the timestamp like this:

created: 2022-08-20T23:46:58+02:00

Occurs on

Plugin version 0.3.1

Additional context I've also tried the following templates with little success: created: {{ date }}

created: "{ INVALID TEMPLATE TAG - object undefined }": null

Or

created: {{date:YYYY-MM-DDTHH:mm:ssZ}} , created: {{ date : YYYY-MM-DDTHH:mm:ssZ }}

I'm not sure if it is a bug though or if I'm just doing something wrong

ltctceplrm commented 2 years ago

If I use the Templater plugin to add the timestamp with <% tp.date.now("YYYY-MM-DD[T]HH:mm:ssZ") %> instead of using the Obsidian template then it actually works, weird

mProjectsCode commented 2 years ago

it is probably because of the extra : in there

ltctceplrm commented 2 years ago

Oh, which : should I remove to have it work with the default template?

mProjectsCode commented 2 years ago

try removing the ones in the date template

mProjectsCode commented 2 years ago

nvm, the way you are trying to use the themplates is not implemented yet

ltctceplrm commented 2 years ago

Oh okay, I'll continue using templater in the meantime since then the timestamp does work.