Last Sync: 2026-01-24 12:45 (Mobile)
This commit is contained in:
@@ -1,93 +0,0 @@
|
||||
---
|
||||
weekly_summary:
|
||||
tags:
|
||||
- "#Weekly"
|
||||
---
|
||||
---
|
||||
### 지난 주 반성
|
||||
-
|
||||
---
|
||||
### 이번 주 계획
|
||||
#### 지난주 에서 가져온 계획
|
||||
<%*
|
||||
function getPreviousWeek(year, week) {
|
||||
if (week === 1) {
|
||||
year -= 1;
|
||||
let lastWeekOfYear = getISOWeekNumber(new Date(year, 11, 28));
|
||||
return `${year}-W${String(lastWeekOfYear).padStart(2, '0')}`;
|
||||
} else {
|
||||
week -= 1;
|
||||
return `${year}-W${String(week).padStart(2, '0')}`;
|
||||
}
|
||||
}
|
||||
|
||||
function getISOWeekNumber(date) {
|
||||
let day = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
||||
let dayNum = day.getDay() || 7;
|
||||
day.setDate(day.getDate() + 4 - dayNum);
|
||||
let yearStart = new Date(day.getFullYear(), 0, 1);
|
||||
return Math.ceil((((day - yearStart) / 86400000) + 1) / 7);
|
||||
}
|
||||
|
||||
let [year, week] = tp.file.title.split("-W").map(Number);
|
||||
let lastWeek = getPreviousWeek(year, week);
|
||||
let lastWeekPath = "10. Planner/12. Weekly/" + lastWeek;
|
||||
let section = "## 다음 주 계획";
|
||||
let should_include = false;
|
||||
let sectionContent = "";
|
||||
|
||||
let lwfile = tp.file.find_tfile(lastWeekPath);
|
||||
if(lwfile) {
|
||||
const content = await app.vault.read(lwfile);
|
||||
if(content.includes(section)) {
|
||||
let startIndex = content.indexOf(section) + section.length;
|
||||
let endIndex = content.indexOf('\n##', startIndex);
|
||||
endIndex = endIndex === -1 ? content.length : endIndex;
|
||||
sectionContent = content.substring(startIndex, endIndex).trim();
|
||||
should_include = sectionContent.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
tR += should_include ? sectionContent : "없습니다😀";
|
||||
%>
|
||||
#### 이번주 계획
|
||||
-
|
||||
---
|
||||
|
||||
### 다음 주 계획
|
||||
-
|
||||
---
|
||||
### 이번 주 요약
|
||||
|요일| 날짜 | 내용 |
|
||||
|---|---|---|
|
||||
|월|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').format("MM-DD")`| ![[<%* const title0 = tp.file.title; const [year0, week0] = title0.split("-W"); const mondayOfWeek = moment().isoWeekYear(year0).isoWeek(week0).startOf('isoWeek').add(0, 'days').format("YYYY-MM-DD(ddd)"); tR += mondayOfWeek; %>#^summary]] |
|
||||
|화|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(1, 'days').format("MM-DD")`| ![[<%* const title1 = tp.file.title; const [year1, week1] = title1.split("-W"); const tuesdayOfWeek = moment().isoWeekYear(year1).isoWeek(week1).startOf('isoWeek').add(1, 'days').format("YYYY-MM-DD(ddd)"); tR += tuesdayOfWeek; %>#^summary]] |
|
||||
|수|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(2, 'days').format("MM-DD")`| ![[<%* const title2 = tp.file.title; const [year2, week2] = title2.split("-W"); const wednesdayOfWeek = moment().isoWeekYear(year2).isoWeek(week2).startOf('isoWeek').add(2, 'days').format("YYYY-MM-DD(ddd)"); tR += wednesdayOfWeek; %>#^summary]] |
|
||||
|목|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(3, 'days').format("MM-DD")`| ![[<%* const title3 = tp.file.title; const [year3, week3] = title3.split("-W"); const thursdayOfWeek = moment().isoWeekYear(year3).isoWeek(week3).startOf('isoWeek').add(3, 'days').format("YYYY-MM-DD(ddd)"); tR += thursdayOfWeek; %>#^summary]] |
|
||||
|금|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(4, 'days').format("MM-DD")`| ![[<%* const title4 = tp.file.title; const [year4, week4] = title4.split("-W"); const fridayOfWeek = moment().isoWeekYear(year4).isoWeek(week4).startOf('isoWeek').add(4, 'days').format("YYYY-MM-DD(ddd)"); tR += fridayOfWeek; %>#^summary]] |
|
||||
|토|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(5, 'days').format("MM-DD")`| ![[<%* const title5 = tp.file.title; const [year5, week5] = title5.split("-W"); const saturdayOfWeek = moment().isoWeekYear(year5).isoWeek(week5).startOf('isoWeek').add(5, 'days').format("YYYY-MM-DD(ddd)"); tR += saturdayOfWeek; %>#^summary]] |
|
||||
|일|`$=moment("<% tp.file.title %>", "YYYY-[W]WW").startOf('isoWeek').add(6, 'days').format("MM-DD")`| ![[<%* const title6 = tp.file.title; const [year6, week6] = title6.split("-W"); const sundayOfWeek = moment().isoWeekYear(year5).isoWeek(week5).startOf('isoWeek').add(6, 'days').format("YYYY-MM-DD(ddd)"); tR += sundayOfWeek; %>#^summary]] |
|
||||
|
||||
---
|
||||
### 데일리 리뷰
|
||||
```dataviewjs
|
||||
const currentNoteTitle = dv.current().file.name;
|
||||
const weekNumberMatch = currentNoteTitle.match(/(\d{4}-W\d{2})/);
|
||||
|
||||
if (weekNumberMatch) {
|
||||
const weekNumber = weekNumberMatch[0];
|
||||
const dailyNoteFolder = '"10. Planner/11. Daily"';
|
||||
|
||||
dv.pages(dailyNoteFolder)
|
||||
.where(page => {
|
||||
const pageDate = moment(page.file.name, "YYYY-MM-DD(ddd)");
|
||||
return pageDate.isValid() && pageDate.isoWeek() === moment(weekNumber, "YYYY-[W]WW").isoWeek();
|
||||
})
|
||||
.forEach(page => {
|
||||
const dailyReview = page.daily_review || "없음";
|
||||
dv.paragraph(`**${page.file.name}**: ${dailyReview}`);
|
||||
});
|
||||
} else {
|
||||
dv.paragraph("이 노트의 제목에 ISO 주 정보가 포함되지 않았습니다.");
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user