Comments (8)
@dummifiedme @TSSlade: There are some known issues with powershell and Templater that I haven't been able to resolve for now.
However if you want to get today's date minus a day offset, you can with the new internal template {{tp_date}}
. With this, you're now able to specify a date offset as argument like so: {{tp_date:offset="-3"}}
. You can also specify the date format with the f
argument, i.e. {{tp_date:offset="-3",f="yyyy-MM-dd"}}
.
Update Templater to 0.5.7 to use it !
I'm closing this because it's similar to #9 or #15 for powershell problems, but don't hesitate to re-open this if you have any problem using {{tp_date}}
from templater.
what error is obsidian throwing? i just tried it on mine (not using powershell, macos terminal) but it didn't have any issues creating a note with the same general link format that you posted above
from templater.
The Obsidian error is like a notification, I am not able to read it. In the editor though, it just doesn't convert to the expected date but stays just as the template {{}}.
Can you share the Templater command that you used?
from templater.
mines going to be different because I'm using the OSX date
command but here it is: date -j +"[[%Y-%m-%d_%a|%Y-%m-%d]]"
from templater.
I can affirm a similar experience to @dummifiedme's. My console (Ctrl+Shift+I
) provides the following:
Failed to load resource: net::ERR_CONNECTION_REFUSED
(unknown) Error with the template nĀ° 2:
Error: Command failed: powershell echo "[[$((Get-Date).AddDays(-7) | Get-Date -UFormat "%Y-%m-%d")]]"
at ChildProcess.exithandler (child_process.js:312)
at ChildProcess.emit (events.js:310)
at maybeClose (internal/child_process.js:1021)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286)
If I remove the powershell
prefix from the custom template command and just lead with echo
, I get the following result (in context):
Previous meeting in series: [[{{"Get-Date -UFormat "%Y-%m-%d")"}}_05h00]]
That is not an error, but it's also not the desired outcome. Any chance the plugin is having a hard time launching/communicating with the Powershell executable?
from templater.
Further follow-up: using the custom templates in the README:
a.k.a.
powershell (Get-Date -UFormat '%Y-%m-%d' (Get-Date).addDays(-1))
...added like so:
from templater.
As far as I remember, I was able to get correct output when using a simple format, the problem arose when I decided to use square brackets and vertical bar in there.
But there must be something missing in the templater for sure.
from templater.
Confirmed that even with neither square brackets nor a pipe present, I experience the same failure mode:
from templater.
Related Issues (20)
- Template parsing error, aborting HOT 7
- Bug when creating a new note with a default template and start typing. HOT 4
- tp.file.cursor should change the mode to edit mode if in reading mode HOT 9
- Template file in templates directory disappears HOT 1
- Quick toggle between different custom checkboxes
- Example for tp.hooks doesn't work HOT 4
- Broken template after updating Templater to v1.18.0 (still working fine with Templater 1.17.0)... HOT 3
- Interaction between Templater and Excalidraw resulting in file content change HOT 3
- Add commands to pallete for creating a note in a specific folder HOT 6
- Templater Syntax Highlight is broken on Obsidian 1.5.0 (Desktop - Catalyst/Insider release) HOT 15
- Templater Hides Properties on Obsidian 1.5.0 HOT 9
- Date variables are not updating to the current system time HOT 2
- tp.date.now HOT 1
- Folder Templates don't work on selected Template Folder location HOT 3
- Folder Templates don't work on selected Template Folder location
- Folder Templates don't work on selected Template Folder location
- Root folder template is triggering twice HOT 2
- need create canvas from the template. HOT 6
- "<% tp.file.cursor(1) %>" is performed with a delay of one hotkey activation in Obsidian 1.5.2 tables HOT 4
- Templater Clobbering Existing Notes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templater.