Browse Source

try to fix legend

tripeur 4 years ago
parent
commit
a98fe7ab22
3 changed files with 3 additions and 3 deletions
  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;

File diff suppressed because it is too large
+ 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;

Some files were not shown because too many files changed in this diff