feat(DatePicker): support datehour (#6732)

* feat(DatePicker): support datehour

* add unit test & edit readme for datehour

* fix(DatePicker): try to fix unit test
This commit is contained in:
zhangyong
2020-07-11 11:25:11 +08:00
committed by GitHub
parent 7b21a23cae
commit 7987287be0
6 changed files with 344 additions and 2 deletions
+25 -1
View File
@@ -155,6 +155,30 @@ export default {
};
```
### Choose DateHour
```html
<van-datetime-picker
v-model="currentDate"
type="datehour"
title="Choose DateTime"
:min-date="minDate"
:max-date="maxDate"
/>
```
```js
export default {
data() {
return {
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: new Date(),
};
},
};
```
### Option Filter
```html
@@ -190,7 +214,7 @@ export default {
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| type | Can be set to `date` `time`<br> `year-month` `month-day` | _string_ | `datetime` |
| type | Can be set to `date` `time`<br> `year-month` `month-day` `datehour` | _string_ | `datetime` |
| title | Toolbar title | _string_ | `''` |
| confirm-button-text | Text of confirm button | _string_ | `Confirm` |
| cancel-button-text | Text of cancel button | _string_ | `Cancel` |