Selaa lähdekoodia

Alter durationDelta to use start/end times instead of deltas

  Since we already have an updated date profile, we can just diff the
  end and start properties instead of attempting to calculate based on
  the diffs. It means we achieve the same thing but can use existing
  utilities that support moment objects.
Livvy Mackintosh 7 vuotta sitten
vanhempi
sitoutus
965b8656ad
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      src/View.ts

+ 4 - 2
src/View.ts

@@ -660,8 +660,10 @@ 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;
+    let durationDelta = this.diffDates(
+      eventInstance.dateProfile.end,
+      eventInstance.dateProfile.start
+    ) 
 
     this.triggerEventResize(
       eventInstance,