diff --git a/__test__/__snapshots__/time-panel.test.js.snap b/__test__/__snapshots__/time-panel.test.js.snap
index cb76f66..8d9cba5 100644
--- a/__test__/__snapshots__/time-panel.test.js.snap
+++ b/__test__/__snapshots__/time-panel.test.js.snap
@@ -77,7 +77,7 @@ exports[`TimePanel render: correct 12hours in the fixed time list 1`] = `
12:30 PM
@@ -203,11 +203,12 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -215,7 +216,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
01
@@ -223,7 +224,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
02
@@ -231,7 +232,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
03
@@ -239,7 +240,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
04
@@ -247,7 +248,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
05
@@ -255,7 +256,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
06
@@ -263,7 +264,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
07
@@ -271,7 +272,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
08
@@ -279,7 +280,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
09
@@ -287,7 +288,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
10
@@ -295,15 +296,15 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
11
-
12
@@ -311,7 +312,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
13
@@ -319,7 +320,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
14
@@ -327,7 +328,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
15
@@ -335,7 +336,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
16
@@ -343,7 +344,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
17
@@ -351,7 +352,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
18
@@ -359,15 +360,15 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
19
-
20
@@ -375,7 +376,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
21
@@ -383,7 +384,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
22
@@ -391,7 +392,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
23
@@ -417,11 +418,12 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -429,7 +431,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
01
@@ -437,7 +439,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
02
@@ -445,7 +447,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
03
@@ -453,7 +455,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
04
@@ -461,7 +463,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
05
@@ -469,7 +471,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
06
@@ -477,7 +479,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
07
@@ -485,7 +487,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
08
@@ -493,7 +495,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
09
@@ -501,7 +503,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
10
@@ -509,7 +511,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
11
@@ -517,7 +519,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
12
@@ -525,7 +527,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
13
@@ -533,7 +535,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
14
@@ -541,7 +543,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
15
@@ -549,7 +551,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
16
@@ -557,7 +559,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
17
@@ -565,7 +567,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
18
@@ -573,7 +575,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
19
@@ -581,7 +583,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
20
@@ -589,7 +591,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
21
@@ -597,7 +599,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
22
@@ -605,7 +607,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
23
@@ -613,7 +615,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
24
@@ -621,7 +623,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
25
@@ -629,7 +631,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
26
@@ -637,7 +639,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
27
@@ -645,7 +647,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
28
@@ -653,7 +655,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
29
@@ -661,7 +663,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
30
@@ -669,7 +671,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
31
@@ -677,7 +679,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
32
@@ -685,7 +687,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
33
@@ -693,7 +695,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
34
@@ -701,7 +703,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
35
@@ -709,7 +711,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
36
@@ -717,7 +719,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
37
@@ -725,7 +727,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
38
@@ -733,7 +735,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
39
@@ -741,7 +743,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
40
@@ -749,7 +751,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
41
@@ -757,7 +759,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
42
@@ -765,7 +767,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
43
@@ -773,7 +775,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
44
@@ -781,7 +783,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
45
@@ -789,7 +791,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
46
@@ -797,7 +799,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
47
@@ -805,7 +807,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
48
@@ -813,7 +815,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
49
@@ -821,7 +823,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
50
@@ -829,7 +831,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
51
@@ -837,7 +839,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
52
@@ -845,7 +847,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
53
@@ -853,7 +855,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
54
@@ -861,7 +863,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
55
@@ -869,7 +871,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
56
@@ -877,7 +879,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
57
@@ -885,7 +887,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
58
@@ -893,7 +895,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
59
@@ -919,11 +921,12 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -931,7 +934,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
01
@@ -939,7 +942,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
02
@@ -947,7 +950,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
03
@@ -955,7 +958,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
04
@@ -963,7 +966,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
05
@@ -971,7 +974,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
06
@@ -979,7 +982,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
07
@@ -987,7 +990,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
08
@@ -995,7 +998,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
09
@@ -1003,7 +1006,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
10
@@ -1011,7 +1014,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
11
@@ -1019,7 +1022,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
12
@@ -1027,7 +1030,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
13
@@ -1035,7 +1038,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
14
@@ -1043,7 +1046,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
15
@@ -1051,7 +1054,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
16
@@ -1059,7 +1062,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
17
@@ -1067,7 +1070,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
18
@@ -1075,7 +1078,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
19
@@ -1083,7 +1086,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
20
@@ -1091,7 +1094,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
21
@@ -1099,7 +1102,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
22
@@ -1107,7 +1110,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
23
@@ -1115,7 +1118,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
24
@@ -1123,7 +1126,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
25
@@ -1131,7 +1134,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
26
@@ -1139,7 +1142,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
27
@@ -1147,7 +1150,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
28
@@ -1155,7 +1158,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
29
@@ -1163,7 +1166,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
30
@@ -1171,7 +1174,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
31
@@ -1179,7 +1182,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
32
@@ -1187,7 +1190,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
33
@@ -1195,7 +1198,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
34
@@ -1203,7 +1206,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
35
@@ -1211,7 +1214,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
36
@@ -1219,7 +1222,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
37
@@ -1227,7 +1230,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
38
@@ -1235,7 +1238,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
39
@@ -1243,7 +1246,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
40
@@ -1251,7 +1254,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
41
@@ -1259,7 +1262,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
42
@@ -1267,7 +1270,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
43
@@ -1275,7 +1278,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
44
@@ -1283,7 +1286,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
45
@@ -1291,7 +1294,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
46
@@ -1299,7 +1302,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
47
@@ -1307,7 +1310,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
48
@@ -1315,7 +1318,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
49
@@ -1323,7 +1326,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
50
@@ -1331,7 +1334,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
51
@@ -1339,7 +1342,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
52
@@ -1347,7 +1350,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
53
@@ -1355,7 +1358,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
54
@@ -1363,7 +1366,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
55
@@ -1371,7 +1374,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
56
@@ -1379,7 +1382,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
57
@@ -1387,7 +1390,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
58
@@ -1395,7 +1398,7 @@ exports[`TimePanel render: correct classes of the columns 1`] = `
-
59
@@ -1494,7 +1497,7 @@ exports[`TimePanel render: correct classes of the fixed time list 1`] = `
-
12:30
@@ -1620,11 +1623,12 @@ exports[`TimePanel render: correct columns by format 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
08
@@ -1632,7 +1636,7 @@ exports[`TimePanel render: correct columns by format 1`] = `
-
09
@@ -1640,7 +1644,7 @@ exports[`TimePanel render: correct columns by format 1`] = `
-
10
@@ -1648,7 +1652,7 @@ exports[`TimePanel render: correct columns by format 1`] = `
-
11
@@ -1674,11 +1678,12 @@ exports[`TimePanel render: correct columns by format 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -1686,7 +1691,7 @@ exports[`TimePanel render: correct columns by format 1`] = `
-
30
@@ -1712,11 +1717,12 @@ exports[`TimePanel render: correct columns by format 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
AM
@@ -1724,7 +1730,7 @@ exports[`TimePanel render: correct columns by format 1`] = `
-
PM
diff --git a/__test__/__snapshots__/time-range.test.js.snap b/__test__/__snapshots__/time-range.test.js.snap
index 34d8e87..027f33c 100644
--- a/__test__/__snapshots__/time-range.test.js.snap
+++ b/__test__/__snapshots__/time-range.test.js.snap
@@ -24,11 +24,12 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
12
@@ -36,15 +37,15 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
02
-
04
@@ -52,15 +53,15 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
06
-
08
@@ -68,7 +69,7 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
10
@@ -94,11 +95,12 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -106,7 +108,7 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
30
@@ -132,19 +134,20 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
AM
-
PM
@@ -184,19 +187,20 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
12
-
02
@@ -204,15 +208,15 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
04
-
06
@@ -220,7 +224,7 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
08
@@ -228,7 +232,7 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
10
@@ -254,11 +258,12 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
00
@@ -266,7 +271,7 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
-
30
@@ -292,19 +297,20 @@ exports[`TimeRange render: correct classes of the columns 1`] = `
style="overflow: hidden scroll; height: 100%; margin-right: -0px;"
>
-
AM
-
PM
diff --git a/__test__/calendar-panel.test.js b/__test__/calendar-panel.test.js
index 10c734c..ddd439b 100644
--- a/__test__/calendar-panel.test.js
+++ b/__test__/calendar-panel.test.js
@@ -56,7 +56,7 @@ describe('CalendarPanel', () => {
wrapper = shallowMount(CalendarPanel, {
propsData: {
type,
- value: new Date(Date.UTC(2019, 9, 1, 10)),
+ value: new Date(2019, 9, 1, 10),
},
});
expect(wrapper.element).toMatchSnapshot();
diff --git a/__test__/time-panel.test.js b/__test__/time-panel.test.js
index a8d4332..f109964 100644
--- a/__test__/time-panel.test.js
+++ b/__test__/time-panel.test.js
@@ -11,7 +11,7 @@ describe('TimePanel', () => {
it('render: correct classes of the columns', () => {
wrapper = mount(TimePanel, {
propsData: {
- value: new Date(Date.UTC(2019, 9, 4, 12, 30, 30)),
+ value: new Date(2019, 9, 4, 12, 30, 30),
disabledTime: date => date.getHours() < 10,
},
});
@@ -21,7 +21,7 @@ describe('TimePanel', () => {
it('render: correct columns by format', () => {
wrapper = mount(TimePanel, {
propsData: {
- value: new Date(Date.UTC(2019, 9, 4)),
+ value: new Date(2019, 9, 4),
format: 'hh:mm a',
minuteStep: 30,
hourOptions: Array.from({ length: 10 }).map((_, i) => i + 8),
@@ -33,7 +33,7 @@ describe('TimePanel', () => {
it('render: correct classes of the fixed time list', () => {
wrapper = mount(TimePanel, {
propsData: {
- value: new Date(Date.UTC(2019, 10, 9, 12, 30)),
+ value: new Date(2019, 10, 9, 12, 30),
disabledTime: date => date.getHours() < 10,
timePickerOptions: {
start: '08:30',
@@ -49,7 +49,7 @@ describe('TimePanel', () => {
it('render: correct 12hours in the fixed time list', () => {
wrapper = mount(TimePanel, {
propsData: {
- value: new Date(Date.UTC(2019, 10, 9, 12, 30)),
+ value: new Date(2019, 10, 9, 12, 30),
timePickerOptions: {
start: '08:30',
step: '00:30',
diff --git a/__test__/time-range.test.js b/__test__/time-range.test.js
index 886ea62..a0edba3 100644
--- a/__test__/time-range.test.js
+++ b/__test__/time-range.test.js
@@ -14,10 +14,7 @@ describe('TimeRange', () => {
format: 'hh:mm a',
minuteStep: 30,
hourStep: 2,
- value: [
- new Date(Date.UTC(2019, 9, 4, 8, 30, 0)),
- new Date(Date.UTC(2019, 9, 4, 18, 30, 0)),
- ],
+ value: [new Date(2019, 9, 4, 8, 30, 0), new Date(2019, 9, 4, 18, 30, 0)],
},
});
expect(wrapper.element).toMatchSnapshot();
diff --git a/src/time/list-columns.vue b/src/time/list-columns.vue
index 4a64ecb..516b7aa 100644
--- a/src/time/list-columns.vue
+++ b/src/time/list-columns.vue
@@ -1,12 +1,12 @@
-
+
-
{{ item.text }}
@@ -177,7 +177,9 @@ export default {
const { target, currentTarget } = evt;
if (target.tagName.toUpperCase() !== 'LI') return;
const type = currentTarget.getAttribute('data-type');
- const value = parseInt(target.getAttribute('data-value'), 10);
+ const colIndex = parseInt(currentTarget.getAttribute('data-index'), 10);
+ const cellIndex = parseInt(target.getAttribute('data-index'), 10);
+ const { value } = this.columns[colIndex].list[cellIndex];
this.$emit('select', value, type);
},
},