From ccd96b45b2bafeaff8333477d99647da2dbe4b8b Mon Sep 17 00:00:00 2001 From: Gregor Wassmann Date: Fri, 14 May 2021 15:33:35 +0200 Subject: [PATCH] Use consistent date definitions --- COMPONENT_INDEX.md | 24 ++++++++++++------------ docs/src/COMPONENT_API.json | 6 +++--- src/DatePicker/DatePicker.svelte | 6 +++--- types/DatePicker/DatePicker.d.ts | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index e565a00a..c65a11a8 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1001,18 +1001,18 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :------------- | :--------------- | :------- | :--------------------------------------------------- | ------------------------------------------------ | --------------------------------------------- | -| value | let | Yes | number | string | "" | Specify the date picker input value | -| datePickerType | let | No | "simple" | "single" | "range" | "simple" | Specify the date picker type | -| appendTo | let | No | HTMLElement | -- | Specify the element to append the calendar to | -| dateFormat | let | No | string | "m/d/Y" | Specify the date format | -| maxDate | let | No | null | string | Date | null | Specify the maximum date | -| minDate | let | No | null | string | Date | null | Specify the minimum date | -| locale | let | No | string | "en" | Specify the locale | -| short | let | No | boolean | false | Set to `true` to use the short variant | -| light | let | No | boolean | false | Set to `true` to enable the light variant | -| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the date picker element | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :------------- | :--------------- | :------- | :-------------------------------------------------------- | ------------------------------------------------ | --------------------------------------------- | +| value | let | Yes | number | string | Date | "" | Specify the date picker input value | +| datePickerType | let | No | "simple" | "single" | "range" | "simple" | Specify the date picker type | +| appendTo | let | No | HTMLElement | -- | Specify the element to append the calendar to | +| dateFormat | let | No | string | "m/d/Y" | Specify the date format | +| maxDate | let | No | null | number | string | Date | null | Specify the maximum date | +| minDate | let | No | null | number | string | Date | null | Specify the minimum date | +| locale | let | No | string | "en" | Specify the locale | +| short | let | No | boolean | false | Set to `true` to use the short variant | +| light | let | No | boolean | false | Set to `true` to enable the light variant | +| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the date picker element | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index bccb25f4..93fb7831 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -2262,7 +2262,7 @@ "name": "value", "kind": "let", "description": "Specify the date picker input value", - "type": "number | string", + "type": "number | string | Date", "value": "\"\"", "isFunction": false, "constant": false, @@ -2291,7 +2291,7 @@ "name": "maxDate", "kind": "let", "description": "Specify the maximum date", - "type": "null | string | Date", + "type": "null | number | string | Date", "value": "null", "isFunction": false, "constant": false, @@ -2301,7 +2301,7 @@ "name": "minDate", "kind": "let", "description": "Specify the minimum date", - "type": "null | string | Date", + "type": "null | number | string | Date", "value": "null", "isFunction": false, "constant": false, diff --git a/src/DatePicker/DatePicker.svelte b/src/DatePicker/DatePicker.svelte index ab6d42af..4e159f65 100644 --- a/src/DatePicker/DatePicker.svelte +++ b/src/DatePicker/DatePicker.svelte @@ -11,7 +11,7 @@ /** * Specify the date picker input value - * @type {number | string} + * @type {number | string | Date} */ export let value = ""; @@ -26,13 +26,13 @@ /** * Specify the maximum date - * @type {null | string | Date} + * @type {null | number | string | Date} */ export let maxDate = null; /** * Specify the minimum date - * @type {null | string | Date} + * @type {null | number | string | Date} */ export let minDate = null; diff --git a/types/DatePicker/DatePicker.d.ts b/types/DatePicker/DatePicker.d.ts index 1ea59415..f8287ea1 100644 --- a/types/DatePicker/DatePicker.d.ts +++ b/types/DatePicker/DatePicker.d.ts @@ -13,7 +13,7 @@ export interface DatePickerProps * Specify the date picker input value * @default "" */ - value?: number | string; + value?: number | string | Date; /** * Specify the element to append the calendar to @@ -30,13 +30,13 @@ export interface DatePickerProps * Specify the maximum date * @default null */ - maxDate?: null | string | Date; + maxDate?: null | number | string | Date; /** * Specify the minimum date * @default null */ - minDate?: null | string | Date; + minDate?: null | number | string | Date; /** * Specify the locale