Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/tangy-mirrors-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@clack/prompts": minor
"@clack/core": minor
Comment on lines +2 to +3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we're v1.0, we're going to have to hold minor features until we're ready to do a release! Does a 2 week cadence seem fair?

Will spin up a discussion in Discord

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss on discord 👍

i think that's fine though

---

Adds `date` prompt with format support (YYYY/MM/DD, MM/DD/YYYY, DD/MM/YYYY).
24 changes: 24 additions & 0 deletions examples/basic/date.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as p from '@clack/prompts';
import color from 'picocolors';

async function main() {
const result = await p.date({
message: color.magenta('Pick a date'),
format: 'YYYY/MM/DD',
});

const secondResult = await p.date({
message: color.magenta('Modify this date:'),
format: 'YYYY/MM/DD',
defaultValue: '2025-01-01',
});

if (p.isCancel(result) || p.isCancel(secondResult)) {
p.cancel('Operation cancelled.');
process.exit(0);
}

p.outro(`Selected dates: ${color.cyan(result)} and ${color.cyan(secondResult)}`);
}

main().catch(console.error);
3 changes: 2 additions & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"progress": "jiti ./progress.ts",
"spinner": "jiti ./spinner.ts",
"path": "jiti ./path.ts",
"spinner-ci": "npx cross-env CI=\"true\" jiti ./spinner-ci.ts",
"date": "jiti ./date.ts",
"spinner-ci": "npx cross-env CI=\"true\" jiti ./spinner-ci.ts",
"spinner-timer": "jiti ./spinner-timer.ts",
"task-log": "jiti ./task-log.ts"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ export type { AutocompleteOptions } from './prompts/autocomplete.js';
export { default as AutocompletePrompt } from './prompts/autocomplete.js';
export type { ConfirmOptions } from './prompts/confirm.js';
export { default as ConfirmPrompt } from './prompts/confirm.js';
export type { DateFormat, DateOptions } from './prompts/date.js';
export { default as DatePrompt } from './prompts/date.js';
export type { GroupMultiSelectOptions } from './prompts/group-multiselect.js';
export { default as GroupMultiSelectPrompt } from './prompts/group-multiselect.js';
export type { MultiSelectOptions } from './prompts/multi-select.js';
Expand Down
Loading
Loading