Commit 29a91fbb6133a937866e81e7b552ee079002a99c

Authored by Sergio Crisostomo
1 parent 732b32e4

Correct passing of `confirm` prop, correct initial values when no value is passed

src/components/date-picker/base/time-spinner.vue
... ... @@ -28,15 +28,15 @@
28 28 props: {
29 29 hours: {
30 30 type: [Number, String],
31   - default: 0
  31 + default: NaN
32 32 },
33 33 minutes: {
34 34 type: [Number, String],
35   - default: 0
  35 + default: NaN
36 36 },
37 37 seconds: {
38 38 type: [Number, String],
39   - default: 0
  39 + default: NaN
40 40 },
41 41 showSeconds: {
42 42 type: Boolean,
... ...
src/components/date-picker/panel/Date/date-panel-mixin.js
... ... @@ -5,10 +5,6 @@ import {initTimeDate } from '../../util';
5 5  
6 6 export default {
7 7 props: {
8   - confirm: {
9   - type: Boolean,
10   - default: false
11   - },
12 8 showTime: {
13 9 type: Boolean,
14 10 default: false
... ...
src/components/date-picker/panel/Time/time-range.vue
... ... @@ -10,9 +10,9 @@
10 10 ref="timeSpinner"
11 11 :steps="steps"
12 12 :show-seconds="showSeconds"
13   - :hours="dateStart.getHours()"
14   - :minutes="dateStart.getMinutes()"
15   - :seconds="dateStart.getSeconds()"
  13 + :hours="value[0] && dateStart.getHours()"
  14 + :minutes="value[0] && dateStart.getMinutes()"
  15 + :seconds="value[0] && dateStart.getSeconds()"
16 16 :disabled-hours="disabledHours"
17 17 :disabled-minutes="disabledMinutes"
18 18 :disabled-seconds="disabledSeconds"
... ... @@ -29,9 +29,9 @@
29 29 ref="timeSpinnerEnd"
30 30 :steps="steps"
31 31 :show-seconds="showSeconds"
32   - :hours="dateEnd.getHours()"
33   - :minutes="dateEnd.getMinutes()"
34   - :seconds="dateEnd.getSeconds()"
  32 + :hours="value[1] && dateEnd.getHours()"
  33 + :minutes="value[1] && dateEnd.getMinutes()"
  34 + :seconds="value[1] && dateEnd.getSeconds()"
35 35 :disabled-hours="disabledHours"
36 36 :disabled-minutes="disabledMinutes"
37 37 :disabled-seconds="disabledSeconds"
... ... @@ -87,8 +87,7 @@
87 87 timePrefixCls: timePrefixCls,
88 88 showDate: false,
89 89 dateStart: dateStart || initTimeDate(),
90   - dateEnd: dateEnd || initTimeDate(),
91   - confirm: false
  90 + dateEnd: dateEnd || initTimeDate()
92 91 };
93 92 },
94 93 computed: {
... ...
src/components/date-picker/panel/Time/time.vue
... ... @@ -7,9 +7,9 @@
7 7 ref="timeSpinner"
8 8 :show-seconds="showSeconds"
9 9 :steps="steps"
10   - :hours="date.getHours()"
11   - :minutes="date.getMinutes()"
12   - :seconds="date.getSeconds()"
  10 + :hours="value[0] && date.getHours()"
  11 + :minutes="value[0] && date.getMinutes()"
  12 + :seconds="value[0] && date.getSeconds()"
13 13 :disabled-hours="disabledHours"
14 14 :disabled-minutes="disabledMinutes"
15 15 :disabled-seconds="disabledSeconds"
... ... @@ -63,8 +63,7 @@
63 63 prefixCls: prefixCls,
64 64 timePrefixCls: timePrefixCls,
65 65 date: this.value[0] || initTimeDate(),
66   - showDate: false,
67   - confirm: false
  66 + showDate: false
68 67 };
69 68 },
70 69 computed: {
... ...
src/components/date-picker/panel/panel-mixin.js
... ... @@ -2,6 +2,12 @@ const prefixCls = 'ivu-picker-panel';
2 2 const datePrefixCls = 'ivu-date-picker';
3 3  
4 4 export default {
  5 + props: {
  6 + confirm: {
  7 + type: Boolean,
  8 + default: false
  9 + }
  10 + },
5 11 methods: {
6 12 iconBtnCls (direction, type = '') {
7 13 return [
... ...