فهرست منبع

try to fix legend

tripeur 4 سال پیش
والد
کامیت
a98fe7ab22
3فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      lib/Timeline.js
  2. 0 0
      lib/Timeline.js.map
  3. 2 2
      src/Timeline.ts

+ 1 - 1
lib/Timeline.js

@@ -304,7 +304,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
                 let i = 0;
                 while (currentDate.isBefore(this._end)) {
                     i += this.legendSpan;
-                    if (nextColumn.diff(currentDate, legendUnit) > 0) {
+                    if (nextColumn.diff(currentDate, legendUnit) >= 0) {
                         row.push({ colspan: i, title: '' + currentDate.format(this.legendUnitFormat[legendUnit]) });
                         i = 0;
                         currentDate = nextColumn;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
lib/Timeline.js.map


+ 2 - 2
src/Timeline.ts

@@ -366,7 +366,7 @@ class Timeline extends LitElement {
     }
 
     updateLegend():void {
-        const legend = [];
+        const legend:Array<Array<legendItem>> = [];
         const legendUnitList:Array<dayjsUnit> = [ "y","M","d","h","m",'s'];
         const legendMinUnitSpan = this.slotDuration * this.legendSpan;
         for (const legendUnit of legendUnitList) {
@@ -386,7 +386,7 @@ class Timeline extends LitElement {
                 let i = 0;
                 while(currentDate.isBefore(this._end)){
                     i+=this.legendSpan;
-                    if(nextColumn.diff(currentDate,legendUnit) > 0  ){                    
+                    if(nextColumn.diff(currentDate,legendUnit) >= 0  ){                    
                         row.push({colspan:i,title:'' + currentDate.format(this.legendUnitFormat[legendUnit])})
                         i = 0;
                         currentDate = nextColumn;

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است