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

Function dropChoiceItems

packages/app-core/src/components/TasksCalendar.tsx:816–830  ·  view source on GitHub ↗

"Move into that day's note" vs "just set the due date" — the menu shown after * dropping a task on a calendar day.

(
  task: VaultTask,
  dateIso: string,
  onMoveTask: (task: VaultTask, dateIso: string) => void,
  onRescheduleTask: (task: VaultTask, dueIso: string) => void
)

Source from the content-addressed store, hash-verified

814/** "Move into that day's note" vs "just set the due date" — the menu shown after
815 * dropping a task on a calendar day. */
816function dropChoiceItems(
817 task: VaultTask,
818 dateIso: string,
819 onMoveTask: (task: VaultTask, dateIso: string) => void,
820 onRescheduleTask: (task: VaultTask, dueIso: string) => void
821): ContextMenuItem[] {
822 const label = parseIsoLocal(dateIso).toLocaleDateString(undefined, {
823 month: 'short',
824 day: 'numeric'
825 })
826 return [
827 { label: `Move into ${label}'s note`, onSelect: () => onMoveTask(task, dateIso) },
828 { label: `Just set due: ${label}`, onSelect: () => onRescheduleTask(task, dateIso) }
829 ]
830}
831
832interface RowProps {
833 task: VaultTask

Callers 2

onUpFunction · 0.85
handlerFunction · 0.85

Calls 1

parseIsoLocalFunction · 0.85

Tested by

no test coverage detected