Showing
1 changed file
with
5 additions
and
5 deletions
@@ -10,7 +10,7 @@ const _formatTime = (timestamp, b) => { | @@ -10,7 +10,7 @@ const _formatTime = (timestamp, b) => { | ||
10 | let time = 'hh:mm'; | 10 | let time = 'hh:mm'; |
11 | let startTime = moment(timestamp); | 11 | let startTime = moment(timestamp); |
12 | let now = moment(); | 12 | let now = moment(); |
13 | - let diff = moment.duration(startTime.startOf('day') - now.startOf('day')).days(); | 13 | + let diff = moment.duration(startTime.clone().startOf('day') - now.startOf('day')).days(); |
14 | 14 | ||
15 | switch (diff) { | 15 | switch (diff) { |
16 | case 0: date = b ? '[预告]' : '[今天]'; break; | 16 | case 0: date = b ? '[预告]' : '[今天]'; break; |
@@ -56,7 +56,7 @@ const _getBestList = () => { | @@ -56,7 +56,7 @@ const _getBestList = () => { | ||
56 | } | 56 | } |
57 | 57 | ||
58 | // 格式化时间 | 58 | // 格式化时间 |
59 | - item.starting_time = _formatTime(item.starting_time, true); | 59 | + item.starting_time = _formatTime(item.starting_time * 1000, true); |
60 | } | 60 | } |
61 | return result.data || []; | 61 | return result.data || []; |
62 | }); | 62 | }); |
@@ -81,7 +81,7 @@ const _getPrelivingList = () => { | @@ -81,7 +81,7 @@ const _getPrelivingList = () => { | ||
81 | let list = result.data || []; | 81 | let list = result.data || []; |
82 | 82 | ||
83 | for (let item of list) { | 83 | for (let item of list) { |
84 | - item.starting_time = _formatTime(item.starting_time); | 84 | + item.starting_time = _formatTime(item.starting_time * 1000); |
85 | } | 85 | } |
86 | return result.data || []; | 86 | return result.data || []; |
87 | }); | 87 | }); |
@@ -112,7 +112,7 @@ const fetchReplayInfo = (videoID) => { | @@ -112,7 +112,7 @@ const fetchReplayInfo = (videoID) => { | ||
112 | .then(result => { | 112 | .then(result => { |
113 | if (result.data) { | 113 | if (result.data) { |
114 | result.data.living = 3; // 自定义的重播 状态 | 114 | result.data.living = 3; // 自定义的重播 状态 |
115 | - result.data.humanTime = _formatTime(result.data.living_start_time); | 115 | + result.data.humanTime = _formatTime(result.data.living_start_time * 1000); |
116 | } | 116 | } |
117 | 117 | ||
118 | return result; | 118 | return result; |
@@ -127,7 +127,7 @@ const fetchLiveInfo = (roomID) => { | @@ -127,7 +127,7 @@ const fetchLiveInfo = (roomID) => { | ||
127 | return liveAPI.get(url, data) | 127 | return liveAPI.get(url, data) |
128 | .then(result => { | 128 | .then(result => { |
129 | if (result.data) { | 129 | if (result.data) { |
130 | - result.data.humanTime = _formatTime(result.data.living_start_time); | 130 | + result.data.humanTime = _formatTime(result.data.living_start_time * 1000); |
131 | } | 131 | } |
132 | 132 | ||
133 | return result; | 133 | return result; |
-
Please register or login to post a comment