🌿 Week of October 26 – November 1, 2026

πŸͺ· Three priorities

  1. Finish Dino
  2. Study for Calc
  3. Catch up

🌸 My Weekly Homework Schedule

// =======================================
// 🌿 WEEKLY HOMEWORK PLANNER
// =======================================

const current = dv.current();

const weekValue = current.week
  ? (typeof current.week.toISODate === "function"
      ? current.week.toISODate()
      : String(current.week))
  : moment().format("YYYY-MM-DD");

const monday = moment(weekValue).startOf("isoWeek");
const sunday = monday.clone().add(6, "days");

const assignments = dv.pages(
  '"study nook/School/Assignments"'
).where(p => p.due);

// Convert work dates to YYYY-MM-DD internally
function dateString(value) {
  if (!value) return "";

  if (typeof value.toISODate === "function") {
    return value.toISODate();
  }

  const parsed = moment(
    String(value).trim(),
    ["MM/DD/YY", "MM/DD/YYYY", "YYYY-MM-DD"],
    true
  );

  if (!parsed.isValid()) return "";

  return parsed.format("YYYY-MM-DD");
}

// Read multiple scheduled work days
function getWorkDays(page) {
  if (!page.work_days) return [];

  const values =
    typeof page.work_days.array === "function"
      ? page.work_days.array()
      : Array.isArray(page.work_days)
        ? page.work_days
        : [page.work_days];

  return values
    .map(dateString)
    .filter(d => d !== "");
}

// Check completion
function isComplete(page) {
  const status = String(page.status || "")
    .trim()
    .toLowerCase();

  return status === "done" ||
         status === "completed";
}

// =======================================
// 🌷 DAILY HOMEWORK SCHEDULE
// =======================================

for (let i = 0; i < 7; i++) {

  const day = monday.clone().add(i, "days");
  const key = day.format("YYYY-MM-DD");

  dv.header(
    3,
    "🌿 " + day.format("dddd, MMMM D")
  );

  const tasks = assignments
    .where(p => getWorkDays(p).includes(key))
    .sort(p => p.due, "asc");

  if (tasks.length > 0) {

    dv.table(
      ["Assignment", "Due", "Status"],
      tasks.map(p => [
        p.file.link,
        moment(dateString(p.due))
          .format("MMM D"),
        p.status || "Not started"
      ])
    );

  } else {

    if (i === 5) {
      dv.paragraph(
        "🌸 Nothing scheduled! Enjoy your free Saturday."
      );
    } else if (i === 6) {
      dv.paragraph(
        "🌱 Nothing scheduled. Time for a weekly reset!"
      );
    } else {
      dv.paragraph(
        "🌱 Nothing scheduled yet. Enjoy some breathing room!"
      );
    }

  }
}

// =======================================
// πŸ“‹ UNSCHEDULED DEADLINES
// =======================================

dv.header(3, "πŸ“‹ Still needs scheduling");

const start = monday.format("YYYY-MM-DD");
const end = sunday.format("YYYY-MM-DD");

const unscheduled = assignments
  .where(p => {

    const due = dateString(p.due);

    const dueThisWeek =
      due >= start && due <= end;

    const scheduledThisWeek = getWorkDays(p)
      .some(d => d >= start && d <= end);

    return dueThisWeek &&
      !scheduledThisWeek &&
      !isComplete(p);

  })
  .sort(p => p.due, "asc");

if (unscheduled.length > 0) {

  dv.table(
    ["Assignment", "Due", "Priority"],
    unscheduled.map(p => [
      p.file.link,
      moment(dateString(p.due))
        .format("ddd, MMM D"),
      p.priority || "Medium"
    ])
  );

} else {

  dv.paragraph(
    "🌸 All assignments due this week have work days scheduled!"
  );

}

πŸ“… Daily plan

🌿 Monday

  • [ ]

🌿 Tuesday

  • [ ]

🌿 Wednesday

  • [ ]

🌿 Thursday

  • [ ]

🌿 Friday

  • [ ]

🌸 Saturday

  • [ ]

🌱 Sunday

  • Weekly reset

⏰ Deadlines to protect time for

🌼 Weekly review

  • Finished:
  • Carry over:
  • Next week's first step:
Built with LogoFlowershow