Skip to content

Commit fe32e13

Browse files
natemoo-reharshaktg43081j
authored
ref(dates): adjust date interface (#487)
Co-authored-by: HarshaVardhan <40317596+harshaktg@users.noreply.github.com> Co-authored-by: James Garbutt <43081j@users.noreply.github.com>
1 parent bdf89a5 commit fe32e13

File tree

10 files changed

+502
-582
lines changed

10 files changed

+502
-582
lines changed

.changeset/early-ads-tap.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/tangy-mirrors-hug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"@clack/core": minor
44
---
55

6-
Adds `date` prompt with format support (YYYY/MM/DD, MM/DD/YYYY, DD/MM/YYYY).
6+
Adds `date` prompt with `format` support (YMD, MDY, DMY)

examples/basic/date.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import color from 'picocolors';
44
async function main() {
55
const result = (await p.date({
66
message: color.magenta('Pick a date'),
7-
format: 'YYYY/MM/DD',
8-
minDate: new Date('2025-01-01'),
9-
maxDate: new Date('2025-12-31'),
7+
format: 'YMD',
8+
minDate: new Date('2026-01-01'),
9+
maxDate: new Date('2026-12-31'),
1010
})) as Date;
1111

1212
if (p.isCancel(result)) {

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type { AutocompleteOptions } from './prompts/autocomplete.js';
22
export { default as AutocompletePrompt } from './prompts/autocomplete.js';
33
export type { ConfirmOptions } from './prompts/confirm.js';
44
export { default as ConfirmPrompt } from './prompts/confirm.js';
5-
export type { DateFormatConfig, DateOptions, DateParts } from './prompts/date.js';
5+
export type { DateFormat, DateOptions, DateParts } from './prompts/date.js';
66
export { default as DatePrompt } from './prompts/date.js';
77
export type { GroupMultiSelectOptions } from './prompts/group-multiselect.js';
88
export { default as GroupMultiSelectPrompt } from './prompts/group-multiselect.js';

0 commit comments

Comments
 (0)