Skip to content

Templater Parsing error when trying to create a Daily Note Template #1544

Closed Answered by LionelRevenge
LionelRevenge asked this question in Help
Discussion options

You must be logged in to vote

Nevermind, i've managed to make it work using variables

it can still be improved by a lot, but here's the code that works for me

<%* 
const day = tp.date.now("dddd");
const dayCapitalized = day.charAt(0).toUpperCase() + day.slice(1);
const month = tp.date.now("MMMM");
const monthCapitalized = month.charAt(0).toUpperCase() + month.slice(1);

if (["Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì"].includes(dayCapitalized)) { 
%>
Giorno Lavorativo: [work:: true]
<%* } %>

## <% dayCapitalized %> <% tp.date.now("D") %> <% monthCapitalized %>

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Zachatoo
Comment options

@LionelRevenge
Comment options

@LionelRevenge
Comment options

Answer selected by LionelRevenge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants