forked from Selig/openclaw-skill
improve(daily-briefing): read yesterday memory note instead of today
This commit is contained in:
@@ -76,6 +76,9 @@ export async function handler(ctx: any) {
|
|||||||
const now = new Date();
|
const now = new Date();
|
||||||
const dateStr = formatDate(now);
|
const dateStr = formatDate(now);
|
||||||
const weekday = getWeekday(now);
|
const weekday = getWeekday(now);
|
||||||
|
const yesterday = new Date(now);
|
||||||
|
yesterday.setDate(yesterday.getDate() - 1);
|
||||||
|
const yesterdayStr = formatDate(yesterday);
|
||||||
|
|
||||||
// 讀取設定
|
// 讀取設定
|
||||||
const userMd = readWorkspaceFile(workspace, 'USER.md');
|
const userMd = readWorkspaceFile(workspace, 'USER.md');
|
||||||
@@ -87,7 +90,7 @@ export async function handler(ctx: any) {
|
|||||||
// 讀取待辦與行程
|
// 讀取待辦與行程
|
||||||
const todoContent = readWorkspaceFile(workspace, 'TODO.md');
|
const todoContent = readWorkspaceFile(workspace, 'TODO.md');
|
||||||
const scheduleContent = readWorkspaceFile(workspace, 'SCHEDULE.md');
|
const scheduleContent = readWorkspaceFile(workspace, 'SCHEDULE.md');
|
||||||
const memoryContent = readWorkspaceFile(workspace, `memory/${dateStr}.md`);
|
const memoryContent = readWorkspaceFile(workspace, `memory/${yesterdayStr}.md`);
|
||||||
|
|
||||||
const todos = parseTodos(todoContent);
|
const todos = parseTodos(todoContent);
|
||||||
const schedule = parseTodaySchedule(scheduleContent, dateStr);
|
const schedule = parseTodaySchedule(scheduleContent, dateStr);
|
||||||
|
|||||||
Reference in New Issue
Block a user