MCPcopy
hub / github.com/callumalpass/tasknotes / getCalendarData

Method getCalendarData

src/utils/TaskManager.ts:1139–1163  ·  view source on GitHub ↗
(year: number, month: number)

Source from the content-addressed store, hash-verified

1137 }
1138
1139 async getCalendarData(year: number, month: number): Promise<Record<string, TaskInfo[]>> {
1140 // For now, return a simple calendar data structure
1141 // This can be optimized later if needed
1142 const tasks = await this.getAllTasks();
1143 const calendarData: Record<string, TaskInfo[]> = {};
1144
1145 for (const task of tasks) {
1146 if (task.scheduled) {
1147 if (!calendarData[task.scheduled]) {
1148 calendarData[task.scheduled] = [];
1149 }
1150 calendarData[task.scheduled].push(task);
1151 }
1152 if (task.due) {
1153 if (!calendarData[task.due]) {
1154 calendarData[task.due] = [];
1155 }
1156 if (!calendarData[task.due].includes(task)) {
1157 calendarData[task.due].push(task);
1158 }
1159 }
1160 }
1161
1162 return calendarData;
1163 }
1164
1165 async getTaskInfoForDate(date: Date): Promise<TaskInfo[]> {
1166 const dateStr = formatDateForStorage(date);

Callers

nothing calls this directly

Calls 1

getAllTasksMethod · 0.95

Tested by

no test coverage detected