MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / showTaskModalDateContextMenu

Function showTaskModalDateContextMenu

src/modals/taskModalActionMenus.ts:38–56  ·  view source on GitHub ↗
(
	context: TaskModalActionMenuContext,
	type: TaskModalDateMenuType
)

Source from the content-addressed store, hash-verified

36}
37
38export function showTaskModalDateContextMenu(
39 context: TaskModalActionMenuContext,
40 type: TaskModalDateMenuType
41): void {
42 const currentValue = getDateValue(context.getState(), type);
43 const modal = new DateTimePickerModal(context.app, {
44 currentDate: currentValue ? getDatePart(currentValue) : undefined,
45 currentTime: currentValue ? getTimePart(currentValue) : undefined,
46 title: getDateMenuTitle(context, type),
47 dateRole: type,
48 plugin: context.plugin,
49 onSelect: (value: string | null, time: string | null) => {
50 context.setDate(type, getSelectedDateValue(value, time));
51 context.onChange();
52 },
53 });
54
55 modal.open();
56}
57
58export function showTaskModalStatusContextMenu(
59 context: TaskModalActionMenuContext,

Callers 2

showDateContextMenuFunction · 0.90

Calls 8

getDatePartFunction · 0.90
getTimePartFunction · 0.90
getDateValueFunction · 0.85
getDateMenuTitleFunction · 0.85
getSelectedDateValueFunction · 0.85
getStateMethod · 0.45
onChangeMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected