<%* // Timed Tasks Inputs 0.3 // Input: Contributor Tag let contributorTag = await tp.system.prompt(“Enter Your Contributor Tag (e.g., Jo)”); if (!contributorTag.startsWith(”#”)) { contributorTag = ”#” + contributorTag; }
// Input: Week Selection let weeks = []; for (let i = 0; i < 12; i++) { let date = moment().subtract(i, ‘weeks’).startOf(‘week’); weeks.push(date.format(‘YYYY-[W]WW’)); } let selectedWeek = await tp.system.suggester(weeks, weeks);
// Calculate weekStart and weekEnd let weekStart = moment(selectedWeek, ‘YYYY-[W]WW’).startOf(‘week’); let weekEnd = moment(weekStart).endOf(‘week’);
// Input: GoalTags const goalTagNotes = app.vault.getMarkdownFiles().filter(file ⇒ { const cache = app.metadataCache.getFileCache(file); return cache && cache.frontmatter && cache.frontmatter.Class === “GoalTag”; }); const goalTagsList = goalTagNotes.map(file ⇒ ”#” + file.basename); console.log(“Notes with Class=‘GoalTag’:”); console.log(goalTagsList.join(‘\n’)); let selectedGoalTags = await tp.user.multiSuggester(tp, item ⇒ item, goalTagsList);
// Format the list of goal tags let listGoalTags = selectedGoalTags.join(’, ’);
// Count Tasks // - [ ] Implement functions to define the missing count tasks variables by filtering and counting the tasks by matching GoalTags, Week, and Contributor %>Contributor:: <% contributorTag %> Week:: <% selectedWeek %> Week Start:: <% weekStart.format(“YYYY-MM-DD”) %> Week End:: <% weekEnd.format(“YYYY-MM-DD”) %> Goal Tags:: <% listGoalTags %>