MCPcopy Create free account
hub / github.com/chhoumann/quickadd / datePrompt

Method datePrompt

src/quickAddApi.ts:934–963  ·  view source on GitHub ↗
(
		app: App,
		header: string,
		options?: {
			placeholder?: string;
			defaultValue?: string;
			dateFormat?: string;
		},
	)

Source from the content-addressed store, hash-verified

932 }
933
934 public static async datePrompt(
935 app: App,
936 header: string,
937 options?: {
938 placeholder?: string;
939 defaultValue?: string;
940 dateFormat?: string;
941 },
942 ) {
943 try {
944 const value = await VDateInputPrompt.Prompt(
945 app,
946 header,
947 options?.placeholder,
948 options?.defaultValue,
949 options?.dateFormat,
950 );
951 if (value && value.startsWith("@date:")) {
952 const iso = value.slice(6);
953 const formatted = options?.dateFormat
954 ? formatISODate(iso, options.dateFormat)
955 : null;
956 return formatted ?? iso;
957 }
958 return value;
959 } catch (error) {
960 throwIfPromptCancelled(error);
961 return undefined;
962 }
963 }
964
965 public static async wideInputPrompt(
966 app: App,

Callers

nothing calls this directly

Calls 3

formatISODateFunction · 0.90
throwIfPromptCancelledFunction · 0.85
PromptMethod · 0.45

Tested by

no test coverage detected