Skip to content

Instantly share code, notes, and snippets.

@TfTHacker
Created October 17, 2021 08:29
Show Gist options
  • Save TfTHacker/9d9769bcf9a87f878205da088e10807e to your computer and use it in GitHub Desktop.
Save TfTHacker/9d9769bcf9a87f878205da088e10807e to your computer and use it in GitHub Desktop.
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