Skip to content

Instantly share code, notes, and snippets.

@CaptSolo
Created March 25, 2024 07:20
Show Gist options
  • Save CaptSolo/5201b51d726b8eae388e105889b6d270 to your computer and use it in GitHub Desktop.
Save CaptSolo/5201b51d726b8eae388e105889b6d270 to your computer and use it in GitHub Desktop.
Obsidian Templater code for a list of Gmail e-mails from a particular week
<%*
// assuming the current file is titled in the format YYYY-Wxx (where xx is the week number)
date1 = tp.date.weekday("YYYY/MM/DD", 0, tp.file.title, "YYYY-[W]W");
date2 = tp.date.weekday("YYYY/MM/DD", 6, tp.file.title, "YYYY-[W]W");
url = "https://mail.google.com/mail/u/0/#search/" + encodeURIComponent(`after:${date1}+before:${date2}`);
tR += `[E-mails from this week](${url})\n`;
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment