Adam Shaw 7 lat temu
rodzic
commit
df87843ac6

+ 10 - 10
src/View.ts

@@ -591,7 +591,7 @@ export default abstract class View extends InteractiveDateComponent {
 
   reportEventDrop(eventInstance, eventMutation, el, ev) {
     let eventManager = this.calendar.eventManager
-    let undoFunc = eventManager.mutateEventsWithId(
+    let revertFunc = eventManager.mutateEventsWithId(
       eventInstance.def.id,
       eventMutation
     )
@@ -609,20 +609,20 @@ export default abstract class View extends InteractiveDateComponent {
       eventInstance,
       // a drop doesn't necessarily mean a date mutation (ex: resource change)
       (dateMutation && dateMutation.dateDelta) || createDuration(0),
-      undoFunc,
+      revertFunc,
       el, ev
     )
   }
 
 
   // Triggers event-drop handlers that have subscribed via the API
-  triggerEventDrop(eventInstance, dateDelta, undoFunc, el, ev) {
+  triggerEventDrop(eventInstance, delta, revertFunc, el, ev) {
     this.publiclyTrigger('eventDrop', [
       {
         el,
         event: eventInstance.toLegacy(this.calendar),
-        dateDelta,
-        undoFunc,
+        delta,
+        revertFunc,
         jsEvent: ev,
         view: this
       }
@@ -680,7 +680,7 @@ export default abstract class View extends InteractiveDateComponent {
   // Must be called when an event in the view has been resized to a new length
   reportEventResize(eventInstance, eventMutation, el, ev) {
     let eventManager = this.calendar.eventManager
-    let undoFunc = eventManager.mutateEventsWithId(
+    let revertFunc = eventManager.mutateEventsWithId(
       eventInstance.def.id,
       eventMutation
     )
@@ -694,20 +694,20 @@ export default abstract class View extends InteractiveDateComponent {
     this.triggerEventResize(
       eventInstance,
       eventMutation.dateMutation.endDelta,
-      undoFunc,
+      revertFunc,
       el, ev
     )
   }
 
 
   // Triggers event-resize handlers that have subscribed via the API
-  triggerEventResize(eventInstance, durationDelta, undoFunc, el, ev) {
+  triggerEventResize(eventInstance, delta, revertFunc, el, ev) {
     this.publiclyTrigger('eventResize', [
       {
         el,
         event: eventInstance.toLegacy(this.calendar),
-        durationDelta,
-        undoFunc,
+        delta,
+        revertFunc,
         jsEvent: ev,
         view: this
       }

+ 1 - 0
src/basic/DayGrid.ts

@@ -151,6 +151,7 @@ export default class DayGrid extends InteractiveDateComponent {
           {
             date: dateEnv.toDate(this.getCellDate(row, col)),
             isAllDay: true,
+            el: this.getCellEl(row, col),
             view
           }
         ])

+ 1 - 1
src/types/input-types.ts

@@ -234,7 +234,7 @@ export interface OptionsInputBase {
 
   viewRender?(arg: { view: View, el: HTMLElement }): void
   viewDestroy?(arg: { view: View, el: HTMLElement }): void
-  dayRender?(arg: { date: Date, isAllDay: boolean, el: HTMLElement }): void
+  dayRender?(arg: { view: View, date: Date, isAllDay: boolean, el: HTMLElement }): void
   windowResize?(view: View): void
   dayClick?(arg: { date: Date, isAllDay: boolean, resource, el: HTMLElement, jsEvent: MouseEvent, view: View }): void // resource for Scheduler
   eventClick?(arg: { el: HTMLElement, event: EventObjectInput, jsEvent: MouseEvent, view: View }): boolean | void

+ 34 - 0
tests/automated/datelib/utils.js

@@ -0,0 +1,34 @@
+
+export function formatIsoTimeZoneOffset(date) {
+  let minutes = date.getTimezoneOffset()
+  let sign = minutes < 0 ? '+' : '-' // whaaa
+  let abs = Math.abs(minutes)
+  let hours = Math.floor(abs / 60)
+  let mins = Math.round(abs % 60)
+
+  return sign + pad(hours) + ':' + pad(mins)
+}
+
+export function formatPrettyTimeZoneOffset(date) {
+  let minutes = date.getTimezoneOffset()
+  let sign = minutes < 0 ? '+' : '-' // whaaa
+  let abs = Math.abs(minutes)
+  let hours = Math.floor(abs / 60)
+  let mins = Math.round(abs % 60)
+
+  return 'GMT' + sign + hours + (mins ? ':' + pad(mins) : '')
+}
+
+function pad(n) {
+  return n < 10 ? '0' + n : '' + n
+}
+
+export function formatIsoDay(date) {
+  return date.toISOString().replace(/T.*/, '')
+}
+
+export function formatIsoTime(date) {
+  return pad(date.getUTCHours(), 2) + ':' +
+    pad(date.getUTCMinutes(), 2) + ':' +
+    pad(date.getUTCSeconds(), 2)
+}

+ 16 - 35
tests/automated/legacy/dayNames.js

@@ -12,11 +12,12 @@ describe('day names', function() {
     '.fc-fri',
     '.fc-sat'
   ]
-  var referenceDate = '2014-05-25 06:00' // A sunday
+  var sundayDate = new Date('2014-05-25T06:00:00Z')
   var locales = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ]
 
   pushOptions({
-    now: moment(referenceDate).toISOString()
+    now: sundayDate,
+    timezone: 'UTC'
   })
 
   afterEach(function() {
@@ -33,53 +34,33 @@ describe('day names', function() {
           locale: 'en'
         })
         dayClasses.forEach(function(cls, index, classes) {
-          var weekdays = moment.weekdays()
-          it('should be ' + weekdays[index], function() {
+          var dayDate = FullCalendar.addDays(sundayDate, index)
+          var dayText = dayDate.toLocaleString('en', { weekday: 'long' })
+
+          it('should be ' + dayText, function() {
             initCalendar({
-              now: moment(referenceDate).add(index, 'days')
+              now: dayDate
             })
-            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(weekdays[index])
+            expect($('.fc-view thead ' + dayClasses[index])).toHaveText(dayText)
           })
         })
       })
 
       $.each(locales, function(index, locale) {
         describe('when locale is ' + locale, function() {
-          beforeEach(function() {
-            moment.locale(locale)
-          })
-
           dayClasses.forEach(function(cls, index, classes) {
-            it('should be the translation for ' + moment.weekdays()[index], function() {
+            var dayDate = FullCalendar.addDays(sundayDate, index)
+            var dayText = dayDate.toLocaleString(locale, { weekday: 'long' })
+
+            it('should be the translation for ' + dayText, function() {
+
               initCalendar({
                 locale: locale,
-                now: moment(referenceDate).add(index, 'days')
+                now: dayDate
               })
 
-              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(moment.weekdays()[index])
-            })
-          })
-        })
-      })
-
-      describe('when daynames are specified', function() {
-        var weekdays = [
-          'Hovjaj',
-          'maSjaj',
-          'veSjaj',
-          'mechjaj',
-          'jevjaj',
-          'parmaqjaj',
-          'HoSjaj'
-        ]
-
-        dayClasses.forEach(function(cls, idx, classes) {
-          it('should be ' + weekdays[idx], function() {
-            initCalendar({
-              dayNames: [].slice.call(weekdays), // copy. in case there is a mutation
-              now: moment(referenceDate).add(idx, 'days')
+              expect($('.fc-view thead ' + dayClasses[index])).toHaveText(dayText)
             })
-            expect($('.fc-view thead ' + cls)).toHaveText(weekdays[idx])
           })
         })
       })

+ 0 - 72
tests/automated/legacy/dayNamesShort.js

@@ -1,72 +0,0 @@
-describe('short day names', function() {
-  var testableClasses = [
-    'month',
-    'agendaWeek',
-    'basicWeek'
-  ]
-  var dayClasses = [
-    '.fc-sun',
-    '.fc-mon',
-    '.fc-tue',
-    '.fc-wed',
-    '.fc-thu',
-    '.fc-fri',
-    '.fc-sat'
-  ]
-  var locales = [ 'es', 'fr', 'de', 'zh-cn', 'es' ]
-
-  afterEach(function() {
-    moment.locale('en') // reset moment's global locale
-  })
-
-  testableClasses.forEach(function(viewClass, index, viewClasses) {
-    describe('when view is ' + viewClass, function() {
-      pushOptions({
-        defaultView: viewClass
-      })
-      describe('when locale is default', function() {
-        it('should be in English', function() {
-          moment.locale('en')
-          initCalendar()
-
-          var weekdays = moment.weekdaysShort()
-          dayClasses.forEach(function(cls, index, classes) {
-            expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index])
-          })
-        })
-      })
-
-      describe('when locale is not default', function() {
-        locales.forEach(function(locale, index, locales) {
-          it('should be in the selected locale', function() {
-            initCalendar({
-              locale: locale
-            })
-
-            moment.locale(locale)
-            var weekdays = moment.weekdaysShort()
-
-            dayClasses.forEach(function(cls, index, classes) {
-              expect($('.fc-view thead ' + cls)[0]).toContainText(weekdays[index])
-            })
-          })
-        })
-      })
-
-      describe('when specified', function() {
-        it('should contain the specified names in the given order', function() {
-          var days = [
-            'Hov.', 'maS.', 'veS.', 'mech.', 'parmaq.', 'HoS.'
-          ]
-          initCalendar({
-            dayNamesShort: days
-          })
-
-          dayClasses.forEach(function(cls, index, classes) {
-            expect($('.fc-view thead ' + cls)[0]).toContainText(days[index])
-          })
-        })
-      })
-    })
-  })
-})

+ 3 - 3
tests/automated/legacy/dayPopoverFormat.js

@@ -13,10 +13,10 @@ describe('dayPopoverFormat', function() {
 
   it('can be set to a custom value', function() {
     initCalendar({
-      dayPopoverFormat: 'ddd, MMMM'
+      dayPopoverFormat: { month: 'long', day: 'numeric' }
     })
     $('.fc-more').simulate('click')
-    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('Tue, July')
+    expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('July 29')
   })
 
   it('is affected by the current locale when the value is default', function() {
@@ -30,7 +30,7 @@ describe('dayPopoverFormat', function() {
   it('still maintains the same format when explicitly set, and there is a locale', function() {
     initCalendar({
       locale: 'fr',
-      dayPopoverFormat: 'YYYY'
+      dayPopoverFormat: { year: 'numeric' }
     })
     $('.fc-more').simulate('click')
     expect($('.fc-more-popover > .fc-header .fc-title')).toHaveText('2014')

+ 12 - 11
tests/automated/legacy/dayRender.js

@@ -1,3 +1,4 @@
+import { formatIsoDay } from '../datelib/utils'
 
 describe('dayRender', function() {
 
@@ -6,11 +7,11 @@ describe('dayRender', function() {
       defaultView: 'month',
       fixedWeekCount: true,
       defaultDate: '2014-05-01',
-      dayRender: function(date, cell) {
-        expect(moment.isMoment(date)).toEqual(true)
-        expect(date.hasTime()).toEqual(false)
-        expect(date.format()).toEqual(cell.getAttribute('data-date'))
-        expect(cell).toBeInDOM()
+      dayRender: function(arg) {
+        expect(arg.date instanceof Date).toEqual(true)
+        expect(arg.isAllDay).toEqual(true)
+        expect(formatIsoDay(arg.date)).toEqual(arg.el.getAttribute('data-date'))
+        expect(arg.el).toBeInDOM()
       }
     }
 
@@ -24,7 +25,7 @@ describe('dayRender', function() {
       defaultView: 'month',
       fixedWeekCount: true,
       defaultDate: '2014-05-01',
-      dayRender: function(date, cell) { }
+      dayRender: function(arg) { }
     }
 
     spyOn(options, 'dayRender').and.callThrough()
@@ -39,7 +40,7 @@ describe('dayRender', function() {
     var options = {
       defaultView: 'basicWeek',
       defaultDate: '2014-05-01',
-      dayRender: function(date, cell) { }
+      dayRender: function(arg) { }
     }
 
     spyOn(options, 'dayRender').and.callThrough()
@@ -53,7 +54,7 @@ describe('dayRender', function() {
     var options = {
       defaultView: 'basicWeek',
       defaultDate: '2014-05-01',
-      dayRender: function(date, cell) { }
+      dayRender: function(arg) { }
     }
 
     spyOn(options, 'dayRender').and.callThrough()
@@ -68,9 +69,9 @@ describe('dayRender', function() {
       defaultView: 'month',
       fixedWeekCount: true,
       defaultDate: '2014-05-01',
-      dayRender: function(date, cell) {
-        if (date.format() === '2014-05-01') {
-          cell.classList.add('mycustomclass')
+      dayRender: function(arg) {
+        if (formatIsoDay(arg.date) === '2014-05-01') {
+          arg.el.classList.add('mycustomclass')
         }
       }
     }

+ 4 - 3
tests/automated/legacy/defaultAllDayEventDuration.js

@@ -2,7 +2,8 @@ describe('defaultAllDayEventDuration', function() {
 
   pushOptions({
     defaultDate: '2014-05-01',
-    defaultView: 'month'
+    defaultView: 'month',
+    timezone: 'UTC'
   })
 
   describe('when forceEventDuration is on', function() {
@@ -24,7 +25,7 @@ describe('defaultAllDayEventDuration', function() {
       })
 
       var event = currentCalendar.clientEvents()[0]
-      expect(event.end).toEqualMoment('2014-05-07')
+      expect(event.end).toEqualDate('2014-05-07')
     })
 
     it('correctly calculates an unspecified end when using a string Duration input', function() {
@@ -40,7 +41,7 @@ describe('defaultAllDayEventDuration', function() {
       })
 
       var event = currentCalendar.clientEvents()[0]
-      expect(event.end).toEqualMoment('2014-05-08')
+      expect(event.end).toEqualDate('2014-05-08')
     })
   })
 

+ 4 - 3
tests/automated/legacy/defaultTimedEventDuration.js

@@ -2,7 +2,8 @@ describe('defaultTimedEventDuration', function() {
 
   pushOptions({
     defaultDate: '2014-05-01',
-    defaultView: 'month'
+    defaultView: 'month',
+    timezone: 'UTC'
   })
 
   describe('when forceEventDuration is on', function() {
@@ -22,7 +23,7 @@ describe('defaultTimedEventDuration', function() {
         ]
       })
       var event = currentCalendar.clientEvents()[0]
-      expect(event.end).toEqualMoment('2014-05-05T06:30:00')
+      expect(event.end).toEqualDate('2014-05-05T06:30:00Z')
     })
 
     it('correctly calculates an unspecified end when using a string Duration input', function() {
@@ -36,7 +37,7 @@ describe('defaultTimedEventDuration', function() {
         ]
       })
       var event = currentCalendar.clientEvents()[0]
-      expect(event.end).toEqualMoment('2014-05-05T07:15:00')
+      expect(event.end).toEqualDate('2014-05-05T07:15:00Z')
     })
   })
 

+ 7 - 6
tests/automated/legacy/displayEventEnd.js

@@ -2,7 +2,8 @@ describe('displayEventEnd', function() {
 
   pushOptions({
     defaultDate: '2014-06-13',
-    timeFormat: 'H:mm'
+    timezone: 'UTC',
+    timeFormat: { hour: 'numeric', minute: '2-digit' }
   })
 
   describeOptions('defaultView', {
@@ -42,7 +43,7 @@ describe('displayEventEnd', function() {
               allDay: false
             } ],
             eventAfterAllRender: function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              expect($('.fc-event .fc-time')).toHaveText('1:00 AM')
               done()
             }
           })
@@ -59,7 +60,7 @@ describe('displayEventEnd', function() {
               allDay: false
             } ],
             eventAfterAllRender: function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              expect($('.fc-event .fc-time')).toHaveText('1:00 AM')
               done()
             }
           })
@@ -99,7 +100,7 @@ describe('displayEventEnd', function() {
               allDay: false
             } ],
             eventAfterAllRender: function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              expect($('.fc-event .fc-time')).toHaveText('1:00 AM')
               done()
             }
           })
@@ -116,7 +117,7 @@ describe('displayEventEnd', function() {
               allDay: false
             } ],
             eventAfterAllRender: function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00')
+              expect($('.fc-event .fc-time')).toHaveText('1:00 AM')
               done()
             }
           })
@@ -133,7 +134,7 @@ describe('displayEventEnd', function() {
               allDay: false
             } ],
             eventAfterAllRender: function() {
-              expect($('.fc-event .fc-time')).toHaveText('1:00 - 2:00')
+              expect($('.fc-event .fc-time')).toHaveText('1:00 AM - 2:00 AM')
               done()
             }
           })

+ 71 - 98
tests/automated/legacy/event-dnd.js

@@ -3,6 +3,7 @@ describe('eventDrop', function() {
 
   beforeEach(function() {
     options = {
+      timezone: 'UTC',
       defaultDate: '2014-06-11',
       editable: true,
       dragScroll: false,
@@ -42,20 +43,16 @@ describe('eventDrop', function() {
                   delay: isTouch ? 200 : 0
                 })
               },
-              function(event, delta, revertFunc) {
-                expect(delta.asDays()).toBe(9)
-                expect(delta.hours()).toBe(0)
-                expect(delta.minutes()).toBe(0)
-                expect(delta.seconds()).toBe(0)
-                expect(delta.milliseconds()).toBe(0)
-
-                expect(event.start).toEqualMoment('2014-06-20')
-                expect(event.end).toBeNull()
+              function(arg) {
+                expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 9 }))
+
+                expect(arg.event.start).toEqualDate('2014-06-20')
+                expect(arg.event.end).toBeNull()
 
-                revertFunc()
-                event = currentCalendar.clientEvents()[0]
+                arg.revertFunc()
+                var event = currentCalendar.clientEvents()[0]
 
-                expect(event.start).toEqualMoment('2014-06-11')
+                expect(event.start).toEqualDate('2014-06-11')
                 expect(event.end).toBeNull()
 
                 done()
@@ -81,20 +78,16 @@ describe('eventDrop', function() {
               dy: $('.fc-day').height()
             })
           },
-          function(event, delta, revertFunc) {
-            expect(delta.asDays()).toBe(5)
-            expect(delta.hours()).toBe(0)
-            expect(delta.minutes()).toBe(0)
-            expect(delta.seconds()).toBe(0)
-            expect(delta.milliseconds()).toBe(0)
-
-            expect(event.start).toEqualMoment('2014-06-16T06:00:00')
-            expect(event.end).toBeNull()
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 5 }))
+
+            expect(arg.event.start).toEqualDate('2014-06-16T06:00:00Z')
+            expect(arg.event.end).toBeNull()
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
 
-            expect(event.start).toEqualMoment('2014-06-11T06:00:00')
+            expect(event.start).toEqualDate('2014-06-11T06:00:00Z')
             expect(event.end).toBeNull()
 
             done()
@@ -140,7 +133,7 @@ describe('eventDrop', function() {
               .simulate('mouseleave')
           }, 500)
         },
-        function(event, delta, revertFunc) {
+        function(arg) {
           expect(options.eventMouseover).not.toHaveBeenCalled()
           expect(options.eventMouseout).not.toHaveBeenCalled()
           done()
@@ -177,20 +170,16 @@ describe('eventDrop', function() {
                   })
                 }, 0)
               },
-              function(event, delta, revertFunc) {
-                expect(delta.days()).toBe(1)
-                expect(delta.hours()).toBe(1)
-                expect(delta.minutes()).toBe(30)
-                expect(delta.seconds()).toBe(0)
-                expect(delta.milliseconds()).toBe(0)
-
-                expect(event.start).toEqualMoment('2014-06-12T07:30:00')
-                expect(event.end).toBeNull()
+              function(arg) {
+                expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 1, hour: 1, minute: 30 }))
+
+                expect(arg.event.start).toEqualDate('2014-06-12T07:30:00Z')
+                expect(arg.event.end).toBeNull()
 
-                revertFunc()
-                event = currentCalendar.clientEvents()[0]
+                arg.revertFunc()
+                var event = currentCalendar.clientEvents()[0]
 
-                expect(event.start).toEqualMoment('2014-06-11T06:00:00')
+                expect(event.start).toEqualDate('2014-06-11T06:00:00Z')
                 expect(event.end).toBeNull()
 
                 done()
@@ -215,20 +204,16 @@ describe('eventDrop', function() {
               dx: $('th.fc-wed').width() * 2 // 2 days
             })
           },
-          function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(2)
-            expect(delta.hours()).toBe(0)
-            expect(delta.minutes()).toBe(0)
-            expect(delta.seconds()).toBe(0)
-            expect(delta.milliseconds()).toBe(0)
-
-            expect(event.start).toEqualMoment('2014-06-13')
-            expect(event.end).toBeNull()
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: 2 }))
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            expect(arg.event.start).toEqualDate('2014-06-13')
+            expect(arg.event.end).toBeNull()
 
-            expect(event.start).toEqualMoment('2014-06-11')
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
+
+            expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
 
             done()
@@ -256,21 +241,17 @@ describe('eventDrop', function() {
               dy: allDayGrid.outerHeight() + hr.outerHeight()
             })
           },
-          function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(0)
-            expect(delta.hours()).toBe(-23)
-            expect(delta.minutes()).toBe(0)
-            expect(delta.seconds()).toBe(0)
-            expect(delta.milliseconds()).toBe(0)
-
-            expect(event.start).toEqualMoment('2014-06-10T01:00:00')
-            expect(event.end).toBeNull()
-            expect(event.allDay).toBe(false)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: -1, hour: 1 }))
+
+            expect(arg.event.start).toEqualDate('2014-06-10T01:00:00Z')
+            expect(arg.event.end).toBeNull()
+            expect(arg.event.allDay).toBe(false)
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
 
-            expect(event.start).toEqualMoment('2014-06-11')
+            expect(event.start).toEqualDate('2014-06-11')
             expect(event.end).toBeNull()
             expect(event.allDay).toBe(true)
 
@@ -312,21 +293,17 @@ describe('eventDrop', function() {
               }
             })
           },
-          function(event, delta, revertFunc) {
-            expect(delta.days()).toBe(-1)
-            expect(delta.hours()).toBe(0)
-            expect(delta.minutes()).toBe(0)
-            expect(delta.seconds()).toBe(0)
-            expect(delta.milliseconds()).toBe(0)
-
-            expect(event.start).toEqualMoment('2014-06-10')
-            expect(event.end).toBeNull()
-            expect(event.allDay).toBe(true)
+          function(arg) {
+            expect(arg.delta).toEqual(FullCalendar.createDuration({ day: -1 }))
+
+            expect(arg.event.start).toEqualDate('2014-06-10')
+            expect(arg.event.end).toBeNull()
+            expect(arg.event.allDay).toBe(true)
 
-            revertFunc()
-            event = currentCalendar.clientEvents()[0]
+            arg.revertFunc()
+            var event = currentCalendar.clientEvents()[0]
 
-            expect(event.start).toEqualMoment('2014-06-11T01:00:00')
+            expect(event.start).toEqualDate('2014-06-11T01:00:00Z')
             expect(event.end).toBeNull()
             expect(event.allDay).toBe(false)
 
@@ -409,35 +386,31 @@ describe('eventDrop', function() {
         eventsRendered = true
       }
     }
-    options.eventDragStart = function(event, jsEvent, uiEvent, view) {
-      expect(this instanceof Element).toBe(true)
-      expect(this).toHaveClass('fc-event')
-      expect(typeof event).toBe('object')
-      expect(typeof jsEvent).toBe('object')
-      expect(typeof uiEvent).toBe('object')
-      expect(typeof view).toBe('object')
+    options.eventDragStart = function(arg) {
+      expect(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.event).toBe('object')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
     }
-    options.eventDragStop = function(event, jsEvent, uiEvent, view) {
+    options.eventDragStop = function(arg) {
       expect(options.eventDragStart).toHaveBeenCalled()
 
-      expect(this instanceof Element).toBe(true)
-      expect(this).toHaveClass('fc-event')
-      expect(typeof event).toBe('object')
-      expect(typeof jsEvent).toBe('object')
-      expect(typeof uiEvent).toBe('object')
-      expect(typeof view).toBe('object')
+      expect(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.event).toBe('object')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
     }
-    options.eventDrop = function(event, delta, revertFunc, jsEvent, uiEvent, view) {
+    options.eventDrop = function(arg) {
       expect(options.eventDragStop).toHaveBeenCalled()
 
-      expect(this instanceof Element).toBe(true)
-      expect(this).toHaveClass('fc-event')
-      expect(typeof event).toBe('object')
-      expect(moment.isDuration(delta)).toBe(true)
-      expect(typeof revertFunc).toBe('function')
-      expect(typeof jsEvent).toBe('object')
-      expect(typeof uiEvent).toBe('object')
-      expect(typeof view).toBe('object')
+      expect(arg.el instanceof Element).toBe(true)
+      expect(arg.el).toHaveClass('fc-event')
+      expect(typeof arg.delta).toBe('object')
+      expect(typeof arg.revertFunc).toBe('function')
+      expect(typeof arg.jsEvent).toBe('object')
+      expect(typeof arg.view).toBe('object')
 
       dropHandler.apply(this, arguments)
     }