Skip to content

Variable: date ​

ts
const 
date
: (
opts
) =>
Promise
<Date | typeof CANCEL_SYMBOL>;

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

The date prompt provides an interactive date picker, allowing users to navigate between year, month, and day segments and increment/decrement values using keyboard controls.

Parameters ​

ParameterType

opts

DateOptions

Returns ​

Promise<Date | typeof CANCEL_SYMBOL>

See ​

https://bomb.sh/docs/clack/packages/prompts/#date-input

Example ​

ts
import { 
date
} from "@clack/prompts";
const
birthday
= await
date
({
message
: "Pick your birthday",
minDate
: new
Date
("1900-01-01"),
initialValue
: new
Date
(),
maxDate
: new
Date
(),
});

基于 MIT 许可证发布