2025년 04월

@VERO
Created Date · 2025년 04월 24일 21:04
Last Updated Date · 2025년 04월 24일 21:04

const now = moment();
const yyyy = now.format("YYYY");
const mm = now.format("MM");

const from = moment(`${yyyy}-${mm}-01`, "YYYY-MM-DD");
const to = moment(from).endOf("month");

console.log("From:", from.format("YYYY-MM-DD"));
console.log("To:", to.format("YYYY-MM-DD"));

dv.table(["Date", "TIL"],
  dv.pages("")
    .where(p => {
      const name = p.file.name;
      if (!/^\d{4}-\d{2}-\d{2}$/.test(name)) return false;

      const date = moment(name, "YYYY-MM-DD");
      return date.isBetween(from, to, null, "[]");
    })
    .sort(p => p.file.name)
    .map(p => [moment(p.file.name, "YYYY-MM-DD").format("YYYY년 MM월 DD일"), p.file.link])
);