Skip to content

Instantly share code, notes, and snippets.

@TfTHacker
Created October 17, 2021 08:06
Show Gist options
  • Save TfTHacker/bd7a365abd19e462428a76bf08ae934d to your computer and use it in GitHub Desktop.
Save TfTHacker/bd7a365abd19e462428a76bf08ae934d to your computer and use it in GitHub Desktop.
Day of Week with templater
<%*
window.fileDate = app.plugins.getPlugin('nldates-obsidian').parseDate(tp.file.title).moment;
window.fileDate = window.fileDate.isValid() ? window.fileDate : moment();
if(fileDate.day()==0) { %>
Sunday
<%* } else if(fileDate.day()==1) { %>- <%'['%> ]
Monday
<%* } else if(fileDate.day()==2) { %>- <%'['%> ]
Tuesday
<%* } else if(fileDate.day()==3) { %>- <%'['%> ]
Wednesday
<%* } else if(fileDate.day()==4) { %>- <%'['%> ]
Thursday
<%* } else if(fileDate.day()==5) { %>- <%'['%> ]
Friday
<%* } else if(fileDate.day()==6) { %>
Saturday
<%* } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment