cristianvasquez / obsidian-prettify

A markdown prettifier for obsidian
GNU General Public License v3.0
131 stars 12 forks source link

I get an unwanted .000Z at the end of my seconds #86

Open jorgb opened 3 years ago

jorgb commented 3 years ago

Hi, my header format looks like;

id: {{UUID}}
created: {{date:YYYY-MM-DD}}T{{date:HH}}:{{date:mm}}:{{date:ss}}
updated: {{date:YYYY-MM-DD}}T{{date:HH}}:{{date:mm}}:{{date:ss}}
tags:
  - note

Which it correctly interprets as I want it in the preformatter shown in the UI.

However, when I execute "Run prettifyer" I get unwanted timezone information and a milliseconds fraction;

---
id: 7b7609c7-d37b-4610-855f-1b18474a8cb8
created: 2021-11-19T10:35:34.000Z
updated: 2021-11-19T10:35:34.000Z
tags:
  - note
---

I didn't specify the timezone demarcation. The ISO standard says it can be even left out. Also the 000 millisec fragment (always) is very redundant.

jay-hankins commented 2 years ago

I was having a formatting problem where it looked correct in the UI but incorrect in documents (#52 is actually more like what I was seeing), and strangely, wrapping the string value in single quotes made this behave correctly in the document.

created: '{{date:YYYY-MM-DD}}T{{date:HH}}:{{date:mm}}:{{date:ss}}'

Might do the trick for you? It fixed my UTC problem.