You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/01/19 02:24:21 UTC

[GitHub] [incubator-echarts] Ovilia commented on a change in pull request #12081: fix bug 11677 calender (Because of DST.)

Ovilia 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_r368260151
 
 

 ##########
 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:
   Please use English for other developers to understand. Thanks!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org