2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
965b8656ad
1 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 4 2
      src/View.ts

+ 4 - 2
src/View.ts

@@ -660,8 +660,10 @@ export default abstract class View extends InteractiveDateComponent {
       this.calendar
       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(
     this.triggerEventResize(
       eventInstance,
       eventInstance,