MCPcopy Create free account
hub / github.com/bombshell-dev/clack / DateOptions

Interface DateOptions

packages/prompts/src/date.ts:11–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 * Options for the {@link date} prompt.
10 */
11export interface DateOptions extends CommonOptions {
12 /**
13 * The message or question shown to the user above the input.
14 */
15 message: string;
16
17 /**
18 * The date format for the input segments.
19 * @deafult based on locale
20 */
21 format?: DateFormat;
22
23 /**
24 * The BCP 47 language tag to use for formatting
25 * @see https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag
26 * @example "en-GB"
27 */
28 locale?: string;
29
30 /**
31 * The default value returned when the user doesn't select a date.
32 */
33 defaultValue?: Date;
34
35 /**
36 * The starting date shown when the prompt first renders.
37 * Users can edit this value before submitting.
38 */
39 initialValue?: Date;
40
41 /**
42 * The minimum allowed date for validation.
43 */
44 minDate?: Date;
45
46 /**
47 * The maximum allowed date for validation.
48 */
49 maxDate?: Date;
50
51 /**
52 * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
53 * that validates user input. If a custom function is given, you should return a `string` or `Error`
54 * to show as a validation error, or `undefined` to accept the result.
55 */
56 validate?: Validate<Date>;
57}
58
59/**
60 * The `date` prompt provides an interactive date picker, allowing users

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected