foam
foam copied to clipboard
Add a date variable for templates in ISO 8601 format
Is your feature request related to a problem? Please describe.
I made my own "created" forematter item in my templates and just discovered it is wrong and now I have hundreds of files with incorrectly formatted datetime entries.
Describe the solution you'd like
As a user that is creating a template, I would like to have a variable available with the ISO8601 datetime as described here https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations so that I do not have to figure out the correct format myself.
Describe alternatives you've considered
I made the format manually in my templates and have a misplaced ":" that breaks correct parsing in other software.
Screenshots or Videos
No response
Just found out it was even more screwed up because my templates had a unicode HYPHEN (\u2010) instead of HYPHEN-MINUS (\u002d) which I must of copy-pasted from somewhere.
Good point, the easy solution here is to just add a FOAM_DATE_ISO
variable which returns the Foam date in ISO format (see variable-resolver.ts
).
At some point I have been thinking of adding a more powerful templating engine, basically something that can run JS so that there is more flexibility around templates, but I haven't thought through it yet.