<%*
// 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 (including current week with ISO week numbers)
let weeks = [];
for (let i = 0; i < 13; i++) {
let date = moment().subtract(i, ‘weeks’).startOf(‘isoWeek’);
weeks.push(date.format(‘GGGG-[W]WW’)); // Changed to GGGG for ISO week-numbering year
}
let selectedWeek = await tp.system.suggester(weeks, weeks);
// Calculate weekStart and weekEnd
let weekStart = moment(selectedWeek, ‘GGGG-[W]WW’).startOf(‘isoWeek’);
let weekEnd = moment(weekStart).endOf(‘isoWeek’);
// 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(’, ’);
// Function to create the goal tags query part
const createGoalTagsQuery = (tags) ⇒ {
if (tags.length === 0) return ”;
return tags.map(tag ⇒ (tags include ${tag})).join(’ OR ’);
};
let goalTagsQuery = createGoalTagsQuery(selectedGoalTags);
%>Contributor:: <% contributorTag %>
Week:: <% selectedWeek %>
Week Start:: <% weekStart.format(“YYYY-MM-DD”) %>
Week End:: <% weekEnd.format(“YYYY-MM-DD”) %>
Goal Tags:: <% listGoalTags %>
Tasks Completed
(tags include <% contributorTag %>)
<% goalTagsQuery %>
done
(done on or after <% weekStart.format("YYYY-MM-DD") %>) AND (done on or before <% weekEnd.format("YYYY-MM-DD") %>)
short modeTasks Due or In Progress
(tags include <% contributorTag %>)
<% goalTagsQuery %>
not done
(due on or before <% weekEnd.format("YYYY-MM-DD") %>) OR (no due date)
tags do not include #Blocked
short modeTasks Blocked
(tags include <% contributorTag %>)
(tags include #Blocked)
<% goalTagsQuery %>
not done
short mode- <% contributorTag %> List reasons for blocked tasks
- <% contributorTag %> Generate the Timed Tasks Sheet Report
- <% contributorTag %> Review and Sign this Timed Tasks Sheet Report