Skip to content

Interface: DateOptions ​

Defined in: node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:342

Options for the date prompt.

Extends ​

Properties ​

PropertyTypeDescriptionInherited fromDefined in

accessible?

boolean

‐

CommonOptions.accessible

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:42

defaultValue?

Date

The default value returned when the user doesn't select a date.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:361

format?

DateFormat

The date format for the input segments.

Deafult

based on locale

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:351

initialValue?

Date

The starting date shown when the prompt first renders. Users can edit this value before submitting.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:366

input?

Readable

‐

CommonOptions.input

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:38

locale?

string

The BCP 47 language tag to use for formatting

See

https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag

Example

ts
"en-GB";

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:357

maxDate?

Date

The maximum allowed date for validation.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:374

message

string

The message or question shown to the user above the input.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:346

minDate?

Date

The minimum allowed date for validation.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:370

output?

Writable

‐

CommonOptions.output

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:39

signal?

AbortSignal

‐

CommonOptions.signal

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:40

validate?

Validate<Date>

A function or a Standard Schema that validates user input. If a custom function is given, you should return a string or Error to show as a validation error, or undefined to accept the result.

‐

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:380

withGuide?

boolean

‐

CommonOptions.withGuide

node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:41

基于 MIT 许可证发布