macedotavares / obsidian-utilities

An Alfred workflow focusing on quick entry and logging.
https://github.com/macedotavares/obsidian-utilities
GNU General Public License v3.0
169 stars 7 forks source link

{var:date} format and customizations #11

Closed prattatx closed 3 years ago

prattatx commented 3 years ago

My system date formats have a custom format to show 3 letter day in the medium format: image

Output from Alfred on the script. Date for filename isn't formatted to my custom {date:medium} [11:51:54.709] Obsidian Utilities[Keyword] Processing complete [11:51:54.713] Obsidian Utilities[Keyword] Passing output 'example add to daily note' to Arg and Vars [11:51:54.714] Obsidian Utilities[Arg and Vars] Processing complete [11:51:54.714] Obsidian Utilities[Arg and Vars] Passing output 'example add to daily note' to Conditional [11:51:54.715] Obsidian Utilities[Conditional] Processing complete [11:51:54.715] Obsidian Utilities[Conditional] Passing output 'example add to daily note' to Write Text File [11:51:54.716] Obsidian Utilities[Write Text File] Processing complete [11:51:54.716] Obsidian Utilities[Write Text File] Passing output '/Users/jp5273/Documents/git/jp5273/Notebook/daily_notes/2021-01-22.md' to Open URL [11:51:54.743] Obsidian Utilities[Keyword] Passing output 'example add to daily note' to Run Script

The date format for the filename coming through the log is "yyyy-mm-dd.md". I think Alfred uses date:medium, but somehow it is not.

This is how it turns out within Obsidian: image

Is there a way to set this in variables? how is that done?

macedotavares commented 3 years ago

There's an Args and Vars module right after the keyword. The format for the date variable is defined there. So, if you change the date value to {date:medium}, it should work.

prattatx commented 3 years ago

Excellent! Thank you, again! This worked once I found the Args and Var module. I had been trying to change it in the "Append to file" module.