Просмотр исходного кода

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 лет назад
Родитель
Сommit
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
     )
 
-    // 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,