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