MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / bucketTasksByDueDate

Function bucketTasksByDueDate

packages/shared-domain/src/tasks.ts:393–405  ·  view source on GitHub ↗
(
  tasks: VaultTask[]
)

Source from the content-addressed store, hash-verified

391 * calendar on its date (#236). Tasks without a due date land in the special
392 * `'unscheduled'` key. */
393export function bucketTasksByDueDate(
394 tasks: VaultTask[]
395): Map<string, VaultTask[]> {
396 const map = new Map<string, VaultTask[]>()
397 for (const task of tasks) {
398 if (task.checked) continue
399 const key = task.due ?? 'unscheduled'
400 const list = map.get(key)
401 if (list) list.push(task)
402 else map.set(key, [task])
403 }
404 return map
405}

Callers 2

TasksCalendarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected