yafengstark commented on a change in pull request #12081: fix bug 11677 
calender (Because of DST.)
URL: 
https://github.com/apache/incubator-echarts/pull/12081#discussion_r368260838
 
 

 ##########
 File path: src/coord/calendar/Calendar.js
 ##########
 @@ -384,13 +397,20 @@ Calendar.prototype = {
         // ```
         // will get wrong result because of DST. So we should fix it.
         var date = new Date(range[0].time);
+        // 开始的时间是周几
         var startDateNum = date.getDate();
+        // 结束的时间是周几
         var endDateNum = range[1].date.getDate();
+        // 应该结尾的那一天
         date.setDate(startDateNum + allDay - 1);
         // The bias can not over a month, so just compare date.
+        // 不等,则出现DST问题。等则无DST问题
         if (date.getDate() !== endDateNum) {
-            var sign = date.getTime() - range[1].time > 0 ? 1 : -1;
+            // sign记录调快还是调慢了。三月份那次,
+            // I only change '>' to '<'.
+            var sign = date.getTime() - range[1].time < 0 ? 1 : -1;
             while (date.getDate() !== endDateNum && (date.getTime() - 
range[1].time) * sign > 0) {
+                // 目的就是修改这个allday
 
 Review comment:
   I use English in the newest commit. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to