From ea7c150a59886a6a78e0f41301c10af5549a1663 Mon Sep 17 00:00:00 2001 From: mxie <15623530290@163.com> Date: Tue, 26 Dec 2017 13:01:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0time-picker-options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 46 ++++++++++------- datepicker/calendar-panel.vue | 94 +++++++++++++++++++++++++++++++++-- datepicker/index.vue | 20 ++++++-- demo/App.vue | 9 +++- dist/build.js | 2 +- index.js | 2 +- package.json | 2 +- 7 files changed, 143 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 3629895..fead5ee 100644 --- a/README.md +++ b/README.md @@ -46,24 +46,24 @@ export default { ``` ## Attributes -| Prop | Type | Default | Description | -|-------------------|---------------|-------------|---------------------------------------------------| -| type | String | 'date' | select datepicker or datetimepicker(date/datetime)| -| range | Boolean | false | if true, the type is daterange or datetimerange | -| confirm | Boolean | false | if true, need click the button to change the value| -| format | String | yyyy-MM-dd | Date formatting string | -| lang | String | zh | Translation (en/zh/es/pt-br/fr/ru/de/it/cs) | -| placeholder | String | | input placeholder text | -| width | String/Number | 210 | input size | -| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable | -| not-before | String/Date | '' | Disable all dates before new Date(not-before) | -| not-after | String/Date | '' | Disable all dates after new Date(not-after) | -| shortcuts | Boolean/Array | true | the shortcuts for the range picker | -| first-day-of-week | Number | 7 | set the first day of week (1-7) | -| minute-step | Number | 0 | if > 0 don't show the second picker(0 - 60) | -| input-class | String | 'mx-input' | the input class name | -| confirm-text | String | 'OK' | the default text to display on confirm button | - +| Prop | Type | Default | Description | +|---------------------|---------------|-------------|---------------------------------------------------| +| type | String | 'date' | select datepicker or datetimepicker(date/datetime)| +| range | Boolean | false | if true, the type is daterange or datetimerange | +| confirm | Boolean | false | if true, need click the button to change the value| +| format | String | yyyy-MM-dd | Date formatting string | +| lang | String | zh | Translation (en/zh/es/pt-br/fr/ru/de/it/cs) | +| placeholder | String | | input placeholder text | +| width | String/Number | 210 | input size | +| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable | +| not-before | String/Date | '' | Disable all dates before new Date(not-before) | +| not-after | String/Date | '' | Disable all dates after new Date(not-after) | +| shortcuts | Boolean/Array | true | the shortcuts for the range picker | +| time-picker-options | Object | {} | set timePickerOptions(start, step, end) | +| minute-step | Number | 0 | if > 0 don't show the second picker(0 - 60) | +| first-day-of-week | Number | 7 | set the first day of week (1-7) | +| input-class | String | 'mx-input' | the input class name | +| confirm-text | String | 'OK' | the default text to display on confirm button | ## shortcuts * true - show the default shortcuts @@ -76,6 +76,16 @@ export default { | start | Date | Start Date | | end | Date | End Date | +## time-picker-options +* Object[] - custom shortcuts, [{start, step, end}] + +| Prop | Type | Description | +|-----------------|---------------|------------------------| +| start | String | startTime (eg '00:00') | +| step | String | stepTime (eg '00:30') | +| end | String | endTime (eg '23:30') | + + ## Events | Name | Description | Callback Arguments | |-----------------|------------------------------|------------------------| diff --git a/datepicker/calendar-panel.vue b/datepicker/calendar-panel.vue index cfadfd1..b79d952 100644 --- a/datepicker/calendar-panel.vue +++ b/datepicker/calendar-panel.vue @@ -32,7 +32,17 @@