瀏覽代碼

use startTime for external draggable

Adam Shaw 7 年之前
父節點
當前提交
619114bb0d

+ 2 - 2
src/interactions-external/ExternalElementDragging.ts

@@ -223,8 +223,8 @@ function computeEventForDateSpan(dateSpan: DateSpan, dragMeta: DragMeta, calenda
 
   // only rely on time info if drop zone is all-day,
   // otherwise, we already know the time
-  if (dateSpan.allDay && dragMeta.time) {
-    start = calendar.dateEnv.add(start, dragMeta.time)
+  if (dateSpan.allDay && dragMeta.startTime) {
+    start = calendar.dateEnv.add(start, dragMeta.startTime)
   }
 
   let end = dragMeta.duration ?

+ 3 - 3
src/structs/drag-meta.ts

@@ -8,14 +8,14 @@ onto a calendar. Contains information for creating an event.
 */
 
 export interface DragMetaInput extends EventNonDateInput {
-  time?: DurationInput
+  startTime?: DurationInput
   duration?: DurationInput
   create?: boolean
   sourceId?: string
 }
 
 export interface DragMeta {
-  time: Duration | null
+  startTime: Duration | null
   duration: Duration | null
   create: boolean // create an event when dropped?
   sourceId: string // similar to addEvent's parameter
@@ -23,7 +23,7 @@ export interface DragMeta {
 }
 
 const DRAG_META_PROPS = {
-  time: createDuration,
+  startTime: createDuration,
   duration: createDuration,
   create: Boolean,
   sourceId: String

+ 2 - 2
tests/automated/legacy/external-dnd-advanced.js

@@ -133,7 +133,7 @@ describe('advanced external dnd', function() {
         describe('through the event object\'s time property', function() {
           beforeEach(function() {
             dragEl.attr('data-event', JSON.stringify({
-              time: '05:00' // TODO: rename to startTime
+              startTime: '05:00'
             }))
           })
 
@@ -308,7 +308,7 @@ describe('advanced external dnd', function() {
         describe('through the event object\'s time property', function() {
           beforeEach(function() {
             dragEl.attr('data-event', JSON.stringify({
-              time: '05:00' // TODO: rename to startTime
+              startTime: '05:00'
             }))
           })