templates
code:diary_template.js
(function(){
const formatDate = (date) => {
const year = date.getFullYear();
const month = ('00' + (date.getMonth() + 1)).slice(-2);
const day = ('00' + date.getDate()).slice(-2);
return ${year}/${month}/${day};
}
const today = new Date();
let tomorrow = new Date(today);
let yesterday = new Date(today);
tomorrow.setDate(today.getDate() + 1);
yesterday.setDate(today.getDate() - 1);
const pageTitle = formatDate(today);
const pageURI = encodeURI(scrapbox.io/tanacchi-diary/${pageTitle});
return `${pageTitle}
目標
今日やること(Todo:⬜,WIP:⏩ ,Done:✅)
明日以降やること
やったこと
できなかったこと
今日の学び
感想
`
})()
code:weekly_template.js
(function(){
const formatDate = (date) => {
const year = date.getFullYear();
const month = ('00' + (date.getMonth() + 1)).slice(-2);
const day = ('00' + date.getDate()).slice(-2);
return ${year}/${month}/${day};
}
const today = new Date();
let weekBegin = new Date(today);
let weekEnd = new Date(today);
weekBegin.setDate(today.getDate() - today.getDay() + 1);
weekEnd.setDate(today.getDate() - today.getDay() + 7);
const pageTitle = "Week of " + formatDate(weekBegin) + "~" + formatDate(weekEnd);
const pageURI = encodeURI(scrapbox.io/tanacchi-diary/${pageTitle});
let day = new Date(today);
day.setDate(today.getDate() - today.getDay() + 1 + i);
return [${formatDate(day)}];
}).join("\t");
return `${pageTitle}
目標
やること(Todo:⬜,WIP:⏩ ,Done:✅)
minimum
full
extra
スケジュール
table:schedule
${tableHeader}
(月) (火) (水) (木) (金) (土) (日)
00 時〜
01 時〜
02 時〜
1 限
2 限
3 限
4 限
5 限
18 時〜
19 時〜
20 時〜
21 時〜
22 時〜
23 時〜
この週以降の目標
感想
`
})()