Skip to content

Commit f730a31

Browse files
committed
feat(datepicker): showCount -> showSelectedCount
1 parent 81760d4 commit f730a31

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/date_utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,14 @@ export function safeMultipleDatesFormat(
308308
props: {
309309
dateFormat: string | string[];
310310
locale?: Locale;
311-
showCount?: boolean;
311+
showSelectedCount?: boolean;
312312
},
313313
): string {
314314
if (!dates?.length) {
315315
return "";
316316
}
317317

318-
if (props?.showCount === false) {
318+
if (props?.showSelectedCount === false) {
319319
const formattedAllDates = dates.map((date) => safeDateFormat(date, props));
320320
return formattedAllDates.join(", ");
321321
}

src/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export type DatePickerProps = OmitUnion<
206206
| {
207207
selectsRange?: never;
208208
selectsMultiple?: never;
209-
showCount?: never;
209+
showSelectedCount?: never;
210210
onChange?: (
211211
date: Date | null,
212212
event?:
@@ -217,7 +217,7 @@ export type DatePickerProps = OmitUnion<
217217
| {
218218
selectsRange: true;
219219
selectsMultiple?: never;
220-
showCount?: never;
220+
showSelectedCount?: never;
221221
onChange?: (
222222
date: [Date | null, Date | null],
223223
event?:
@@ -228,7 +228,7 @@ export type DatePickerProps = OmitUnion<
228228
| {
229229
selectsRange?: never;
230230
selectsMultiple: true;
231-
showCount?: boolean;
231+
showSelectedCount?: boolean;
232232
onChange?: (
233233
date: Date[] | null,
234234
event?:
@@ -304,7 +304,7 @@ export default class DatePicker extends Component<
304304
calendarStartDay: undefined,
305305
toggleCalendarOnIconClick: false,
306306
usePointerEvent: false,
307-
showCount: true,
307+
showSelectedCount: true,
308308
};
309309
}
310310

@@ -1344,7 +1344,7 @@ export default class DatePicker extends Component<
13441344
const {
13451345
dateFormat = DatePicker.defaultProps.dateFormat,
13461346
locale,
1347-
showCount = DatePicker.defaultProps.showCount,
1347+
showSelectedCount = DatePicker.defaultProps.showSelectedCount,
13481348
} = this.props;
13491349
const inputValue =
13501350
typeof this.props.value === "string"
@@ -1360,7 +1360,7 @@ export default class DatePicker extends Component<
13601360
? safeMultipleDatesFormat(this.props.selectedDates ?? [], {
13611361
dateFormat,
13621362
locale,
1363-
showCount,
1363+
showSelectedCount,
13641364
})
13651365
: safeDateFormat(this.props.selected, {
13661366
dateFormat,

0 commit comments

Comments
 (0)