Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add Date type for value prop in DateTimePicker widget #311

Merged
merged 1 commit into from
Aug 8, 2022
Merged
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: 3 additions & 3 deletions packages/vantui-doc/src/datetime-picker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { DatetimePicker } from '@antmjs/vantui'

### 选择完整时间

`value` 为时间戳
`value` 为Date对象

```jsx
function Demo() {
Expand Down Expand Up @@ -49,7 +49,7 @@ function Demo() {

### 选择日期(年月日)

`value` 为时间戳,通过传入 `formatter` 函数对选项文字进行处理。
`value` 为Date对象,通过传入 `formatter` 函数对选项文字进行处理。

```jsx
function Demo() {
Expand Down Expand Up @@ -95,7 +95,7 @@ function Demo() {

### 选择日期(年月)

`value` 为时间戳
`value` 为Date对象

```jsx
function Demo() {
Expand Down
2 changes: 1 addition & 1 deletion packages/vantui/types/datetime-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface DatetimePickerProps
* @description 选项的值
* @default null
*/
value?: string | number
value?: string | number | Date
/**
* @description 对选项数组进行过滤,实现自定义时间间隔
*/
Expand Down