Procházet zdrojové kódy

Apply a poorly implemented shim between start/end deltas and duration

  Using the endDelta to determine the durationDelta isn't accurate. The
  endDelta may be undefined but startDelta may exist. If the startDelta
  is negative, then the duration will increase, if positive it will
  decrease. Thus we should sum the inverse of the startDelta with the
  endDelta to get the durationDelta.

  This shim is acting more as pseudo-code as the start/end delta objects
  don't implement addition and subtraction. We need to find a way to do
  this or alternatively use a utility to diff the start / end times from
  the new date definition object. This is what the eventResize callback
  will use anyway.
Livvy Mackintosh před 7 roky
rodič
revize
e563982741
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      src/View.ts

+ 4 - 1
src/View.ts

@@ -660,9 +660,12 @@ export default abstract class View extends InteractiveDateComponent {
       this.calendar
     )
 
+    // endDelta is equal to the durationDelta but startDelta is the inverse to the durationDelta
+    let durationDelta = (-eventMutation.dateMutation.startDelta) + eventMutation.dateMutation.endDelta;
+
     this.triggerEventResize(
       eventInstance,
-      eventMutation.dateMutation.endDelta,
+      durationDelta,
       undoFunc,
       el, ev
     )