Ver código fonte

fix legend offset bug

tripeur 4 anos atrás
pai
commit
501d84f26b
3 arquivos alterados com 3 adições e 1 exclusões
  1. 1 0
      lib/Timeline.js
  2. 0 0
      lib/Timeline.js.map
  3. 2 1
      src/Timeline.ts

+ 1 - 0
lib/Timeline.js

@@ -352,6 +352,7 @@ let Timeline = class Timeline extends lit_element_1.LitElement {
                     currentDate.add(1, legendUnit).diff(currentDate, "m") >= legendMinUnitSpan);
             if (isLegendPossible) {
                 let currentHeader = currentDate.format(format);
+                nextColumn = currentDate;
                 const row = [];
                 let i = 0;
                 for (let j = 0; j < nCol; j++) {

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
lib/Timeline.js.map


+ 2 - 1
src/Timeline.ts

@@ -420,7 +420,7 @@ class Timeline extends LitElement {
       const currentDate = dayjs(this._start);
       const format = this.legendUnitFormat[legendUnit];
       let nextColumn = currentDate.add(legendMinUnitSpan, "m");
-      // Check is the starting and end date can accomodate fews cell of the given unit for this unit of time
+      // Check if the starting and end date can accomodate fews cell of the given unit for this unit of time
       const isLegendPossible =
         // Enough time to fit 1 cell AND
         this._end.diff(this._start, legendUnit) > 0 &&
@@ -431,6 +431,7 @@ class Timeline extends LitElement {
 
       if (isLegendPossible) {
         let currentHeader = currentDate.format(format);
+        nextColumn = currentDate;
         const row: Array<legendItem> = [];
         let i = 0;
         for (let j = 0; j < nCol; j++) {

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff