Skip to content

Instantly share code, notes, and snippets.

@TfTHacker
Created October 17, 2021 08:29
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Weekday/Weekend for templater
<%*
window.fileDate = app.plugins.getPlugin('nldates-obsidian').parseDate(tp.file.title).moment;
window.fileDate = window.fileDate.isValid() ? window.fileDate : moment();
if ( [1,2,3,4,5].includes(fileDate.day()) ) { %>
Weekday
<%* } else if( [0,6].includes(fileDate.day())) { %>
Weekend
<%* } %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment