Skip to content

Commit 8f811f4

Browse files
committed
fix(CDatePicker, CDateRangePicker): improve default types
1 parent c7bb2f6 commit 8f811f4

File tree

8 files changed

+56
-75
lines changed

8 files changed

+56
-75
lines changed

docs/content/forms/date-picker.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -317,38 +317,37 @@ const datePickerList = datePickerElementList.map(datePickerEl => {
317317
{{< bs-table >}}
318318
| Name | Type | Default | Description |
319319
| --- | --- | --- | --- |
320-
| `calendarDate` | date \| string \| null | `null` | Default date of the component. |
320+
| `calendarDate` | date, number, string, null | `null` | Default date of the component. |
321321
| `cancelButtonLabel` | string | `'Cancel'` | Cancel button inner HTML |
322-
| `cancelButtonClasses` | array \| string | `['btn', 'btn-sm', 'btn-ghost-primary']` | CSS class names that will be added to the cancel button |
322+
| `cancelButtonClasses` | array, string | `['btn', 'btn-sm', 'btn-ghost-primary']` | CSS class names that will be added to the cancel button |
323323
| `cleaner` | boolean | `true` | Enables selection cleaner element. |
324-
| `date` | date \| string \| null | `null` | Initial selected date. |
325324
| `confirmButtonLabel` | string | `'OK'` | Confirm button inner HTML |
326-
| `confirmButtonClasses` | array \| string | `['btn', 'btn-sm', 'btn-primary']` | CSS class names that will be added to the confirm button |
327-
| `date` | date \| string \| null | `null` | Default value of the component |
325+
| `confirmButtonClasses` | array, string | `['btn', 'btn-sm', 'btn-primary']` | CSS class names that will be added to the confirm button |
326+
| `date` | date, number, string, null | `null` | Default value of the component |
328327
| `disabled` | boolean | `false` | Toggle the disabled state for the component. |
329328
| `disabledDates` | array | null | `null` | Specify the list of dates that cannot be selected. |
330329
| `firstDayOfWeek` | number | `1` | <p>Sets the day of start week.</p><ul><li>`0` - Sunday</li><li>`1` - Monday</li><li>`2` - Tuesday</li><li>`3` - Wednesday</li><li>`4` - Thursday</li><li>`5` - Friday</li><li>`6` - Saturday</li></ul> |
331330
| `footer` | boolean | `false` | Toggle visibility of footer element. |
332331
| `indicator` | boolean | `true` | Toggle visibility or set the content of the input indicator. |
333-
| `inputDateFormat` | function | `null` | Custom function to format the selected date into a string according to a custom format. |
334-
| `inputDateParse` | function | `null` | Custom function to parse the input value into a valid Date object. |
332+
| `inputDateFormat` | function, null | `null` | Custom function to format the selected date into a string according to a custom format. |
333+
| `inputDateParse` | function, null | `null` | Custom function to parse the input value into a valid Date object. |
335334
| `inputReadOnly` | boolean | `false` | Toggle the readonly state for the component. |
336335
| `invalid` | boolean | `false` | Toggle the invalid state for the component. |
337336
| `locale` | string | `'default'` | Sets the default locale for components. If not set, it is inherited from the navigator.language. |
338-
| `maxDate` | date \| string \| null | `null` | Max selectable date. |
339-
| `minDate` | date \| string \| null | `null` | Min selectable date. |
340-
| `name` | string | `null` | Set the name attribute for the input element. |
337+
| `maxDate` | date, number, string, null | `null` | Max selectable date. |
338+
| `minDate` | date, number, string, null | `null` | Min selectable date. |
339+
| `name` | string, null | `null` | Set the name attribute for the input element. |
341340
| `placeholder` | string | `'Select time'` | Specifies a short hint that is visible in the input. |
342341
| `selectAdjacementDays` | boolean | `false` | Set whether days in adjacent months shown before or after the current month are selectable. This only applies if the `showAdjacementDays` option is set to true. |
343-
| `selectionType` | `'day'` \| `'week'` \| `'month'` \| `'year'` | `day` | Specify the type of date selection as day, week, month, or year. |
342+
| `selectionType` | `'day'`, `'week'`, `'month'`, `'year'` | `day` | Specify the type of date selection as day, week, month, or year. |
344343
| `showAdjacementDays` | boolean | `true` | Set whether to display dates in adjacent months (non-selectable) at the start and end of the current month. |
345344
| `showWeekNumber` | boolean | `false` | Set whether to display week numbers in the calendar. |
346-
| `size` | `'sm'` \| `'lg'` | `null` | Size the component small or large. |
345+
| `size` | `'sm'`, `'lg'` | `null` | Size the component small or large. |
347346
| `timepicker` | boolean | `false` | Provide an additional time selection by adding select boxes to choose times. |
348347
| `todayButton` | string | `'Today'` | Today button inner HTML |
349-
| `todayButtonClasses` | array \| string | `['btn', 'btn-sm', 'me-2']` | CSS class names that will be added to the today button |
348+
| `todayButtonClasses` | array, string | `['btn', 'btn-sm', 'me-2']` | CSS class names that will be added to the today button |
350349
| `valid` | boolean | `false` | Toggle the valid state for the component. |
351-
| `weekdayFormat` | number \| 'long' \| 'narrow' \| 'short' | `2` | Set length or format of day name. |
350+
| `weekdayFormat` | number, 'long', 'narrow', 'short' | `2` | Set length or format of day name. |
352351
| `weekNumbersLabel` | string | `null` | Label displayed over week numbers in the calendar. |
353352
{{< /bs-table >}}
354353

docs/content/forms/date-range-picker.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -359,43 +359,43 @@ const dateRangePickerList = dateRangePickerElementList.map(dateRangePickerEl =>
359359
{{< bs-table >}}
360360
| Name | Type | Default | Description |
361361
| --- | --- | --- | --- |
362-
| `calendarDate` | date \| string \| null | `null` | Default date of the component. |
362+
| `calendarDate` | date, number, string, null | `null` | Default date of the component. |
363363
| `calendars` | number | `2` | The number of calendars that render on desktop devices. |
364364
| `cancelButton` | string | `'Cancel'` | Cancel button inner HTML |
365-
| `cancelButtonClasses` | array \| string | `['btn', 'btn-sm', 'btn-ghost-primary']` | CSS class names that will be added to the cancel button |
365+
| `cancelButtonClasses` | array, string | `['btn', 'btn-sm', 'btn-ghost-primary']` | CSS class names that will be added to the cancel button |
366366
| `cleaner` | boolean | `true` | Enables selection cleaner element. |
367367
| `confirmButton` | string | `'OK'` | Confirm button inner HTML |
368-
| `confirmButtonClasses` | array \| string | `['btn', 'btn-sm', 'btn-primary']` | CSS class names that will be added to the confirm button |
368+
| `confirmButtonClasses` | array, string | `['btn', 'btn-sm', 'btn-primary']` | CSS class names that will be added to the confirm button |
369369
| `disabled` | boolean | `false` | Toggle the disabled state for the component. |
370-
| `disabledDates` | array \| null | `null` | Specify the list of dates that cannot be selected. |
371-
| `endDate` | date \| string \| null | `null` | Initial selected to date (range). |
372-
| `endName` | string | `null` | Set the name attribute for the end date input element. |
370+
| `disabledDates` | array, null | `null` | Specify the list of dates that cannot be selected. |
371+
| `endDate` | date, number, string, null | `null` | Initial selected to date (range). |
372+
| `endName` | string, null | `null` | Set the name attribute for the end date input element. |
373373
| `firstDayOfWeek` | number | `1` | <p>Sets the day of start week.</p> <ul><li>`0` - Sunday</li><li>`1` - Monday</li><li>`2` - Tuesday</li><li>`3` - Wednesday</li><li>`4` - Thursday</li><li>`5` - Friday</li><li>`6` - Saturday</li></ul> |
374374
| `footer` | boolean | `false` | Toggle visibility of footer element. |
375375
| `indicator` | boolean | `true` | Toggle visibility or set the content of the input indicator. |
376-
| `inputDateFormat` | function | `null` | Custom function to format the selected date into a string according to a custom format. |
377-
| `inputDateParse` | function | `null` | Custom function to parse the input value into a valid Date object. |
376+
| `inputDateFormat` | function, null | `null` | Custom function to format the selected date into a string according to a custom format. |
377+
| `inputDateParse` | function, null | `null` | Custom function to parse the input value into a valid Date object. |
378378
| `inputReadOnly` | boolean | `false` | Toggle the readonly state for the component. |
379379
| `invalid` | boolean | `false` | Toggle the invalid state for the component. |
380380
| `locale` | string | `'default'` | Sets the default locale for components. If not set, it is inherited from the navigator.language. |
381-
| `maxDate` | date \| string \| null | `null` | Max selectable date. |
382-
| `minDate` | date \| string \| null | `null` | Min selectable date. |
381+
| `maxDate` | date, number, string, null | `null` | Max selectable date. |
382+
| `minDate` | date, number, string, null | `null` | Min selectable date. |
383383
| `placeholder` | string | `['Start date', 'End date']` | Specifies a short hint that is visible in the input. |
384384
| `ranges` | object | `{}` | Predefined date ranges the user can select from. |
385-
| `rangesButtonsClasses` | array \| string | `['btn', 'btn-ghost-secondary']` | CSS class names that will be added to ranges buttons |
385+
| `rangesButtonsClasses` | array, string | `['btn', 'btn-ghost-secondary']` | CSS class names that will be added to ranges buttons |
386386
| `selectAdjacementDays` | boolean | `false` | Set whether days in adjacent months shown before or after the current month are selectable. This only applies if the `showAdjacementDays` option is set to true. |
387-
| `selectionType` | `'day'` \| `'week'` \| `'month'` \| `'year'` | `day` | Specify the type of date selection as day, week, month, or year. |
387+
| `selectionType` | `'day'`, `'week'`, `'month'`, `'year'` | `day` | Specify the type of date selection as day, week, month, or year. |
388388
| `separator` | boolean | `true` | Toggle visibility or set the content of the inputs separator. |
389389
| `showAdjacementDays` | boolean | `true` | Set whether to display dates in adjacent months (non-selectable) at the start and end of the current month. |
390390
| `showWeekNumber` | boolean | `false` | Set whether to display week numbers in the calendar. |
391-
| `size` | `'sm'` \| `'lg'` | `null` | Size the component small or large. |
392-
| `startDate` | date \| string \| null | `null` | Initial selected date. |
393-
| `startName` | string | `null` | Set the name attribute for the start date input element. |
391+
| `size` | `'sm'`, `'lg'` | `null` | Size the component small or large. |
392+
| `startDate` | date, number, string, null | `null` | Initial selected date. |
393+
| `startName` | string, null | `null` | Set the name attribute for the start date input element. |
394394
| `timepicker` | boolean | `false` | Provide an additional time selection by adding select boxes to choose times. |
395395
| `todayButton` | string | `'Today'` | Today button inner HTML |
396-
| `todayButtonClasses` | array \| string | `['btn', 'btn-sm', 'me-2']` | CSS class names that will be added to the today button |
396+
| `todayButtonClasses` | array, string | `['btn', 'btn-sm', 'me-2']` | CSS class names that will be added to the today button |
397397
| `valid` | boolean | `false` | Toggle the valid state for the component. |
398-
| `weekdayFormat` | number \| 'long' \| 'narrow' \| 'short' | `2` | Set length or format of day name. |
398+
| `weekdayFormat` | number, 'long', 'narrow', 'short' | `2` | Set length or format of day name. |
399399
| `weekNumbersLabel` | string | `null` | Label displayed over week numbers in the calendar. |
400400
{{< /bs-table >}}
401401

js/dist/date-picker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)