Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6.0: tp.frontmatter returns "NaN" instead of string #195

Closed
Moonbase59 opened this issue May 6, 2021 · 4 comments
Closed

1.6.0: tp.frontmatter returns "NaN" instead of string #195

Moonbase59 opened this issue May 6, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Moonbase59
Copy link

Moonbase59 commented May 6, 2021

Plugin informations (please complete the following information):

  • OS: Linux Mint 20.1/Cinnamon
  • Templater version: 1.6.0
  • Obsidian version: 0.11.13/AppImage, Installer 0.10.11
  • Templater settings: –

Describe the bug
<%+ tp.frontmatter.relation %> returns NaN instead of "Tochter".

Expected behavior
Should return the value in the front matter, in this case "Tochter"

Screenshots
obsidian-templater-bug-NaN

Additional context

My front matter:

---
location: [51.133333,10.416667]
mapmarker: Family
birthday: 1997-05-17
deceased: 2020-05-17
relation: Tochter
tags: family
distance: 100.0
---

My code in the note, comparing Dataview and Templater:

\* `= this.birthday` (`= (date(today) - this.birthday).years + " Jahre"`) † `= this.deceased` `= this.relation`

\* <%+ moment(tp.frontmatter.birthday).format("dd., YYYY-MM-DD") %> (<%+ moment().diff(moment(tp.frontmatter.birthday), "years") %> Jahre) † <%* if (tp.frontmatter.deceased) {tR+=moment(tp.frontmatter.deceased).format("dd., YYYY-MM-DD")} else {tR+="-"} %> <%+ tp.frontmatter.relation %>

Note: Data is fake, my daughter happily lives. This was just put in for testing.

@Moonbase59 Moonbase59 added the bug Something isn't working label May 6, 2021
@Moonbase59
Copy link
Author

Moonbase59 commented May 6, 2021

Possibly related: #188

@Moonbase59
Copy link
Author

With 1.7.0, above now returns <%+ tp.frontmatter.relation %> instead of NaN or Tochter (as it should).

@SilentVoid13
Copy link
Owner

Hey @Moonbase59, sorry for the late response. Thanks for the report. This should be fixed now as of Templater 1.7.1.

Update and tell me if this works now.

@Moonbase59
Copy link
Author

@SilentVoid13 No problem, your response times are great! 1.7.1 fixed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants