TABLE WITHOUT ID file.link AS "Ghi chú"FROM "02_Literature Notes"WHERE assignee = "Trần Đức Nam" and status != "Done" and status != "Canceled"SORT due
Từ task trên Markdown
// get the current Mondayconst today = new Date();const daysToMonday = 6 - today.getDay(); //calculate 1 week from Mondaylet oneWeekFromNow = new Date(today.getTime() + daysToMonday * 24 * 60 * 60 * 1000);//get the first of the month //calculate 1 month from nowconst firstDayOfNextMonth = new Date(today.getFullYear(), today.getMonth()+1, 1);let oneMonthFromNow = firstDayOfNextMonth.getTime();//Get all taskslet tasks = dv.pages().file.tasks;//calculate total and completed taskslet totalTasks = tasks.length;let completedTasks = tasks.where(t => t.completed).length;//calculate total and completed tasks this weeklet totalWeek = tasks.filter(task => task.due && new Date(task.due) <= oneWeekFromNow).length;let completedWeek = tasks.where(t => t.completed && t.due && new Date(t.due) <= oneWeekFromNow).length;//calculate total and completed tasks this monthlet totalMonth = tasks.filter(task => task.due && new Date(task.due) <= oneMonthFromNow).length;let completedMonth = tasks.where(t => t.completed && t.due && new Date(t.due) <= oneMonthFromNow).length;//print progress barfunction progress(value, total) { let pct = value/total * 100; return `<progress value="${parseInt(pct)}" max="100"></progress> | ${parseInt(pct)} %`}//print progress bars in tabledv.span(`| | Trạng thái | || --- | --- | --- || **Toàn bộ** | ${progress(completedTasks, totalTasks)} || **Trong tháng**| ${progress(completedMonth, totalMonth)} || **Trong tuần** | ${progress(completedWeek, totalWeek)} |`)
TABLE WITHOUT ID task.text AS "Nhiệm vụ", file.link AS "Từ ghi chú", task.created AS "Ngày tạo", task.due AS "Thời hạn", task.schedule AS "Ngày dự định", task.start AS "Ngày bắt đầu"FLATTEN file.tasks as taskWHERE task.checked != trueSORT updated DESC