diff --git a/app/coffeescripts/calendar/Calendar.coffee b/app/coffeescripts/calendar/Calendar.coffee index 26b619f20ef..0c6569aac47 100644 --- a/app/coffeescripts/calendar/Calendar.coffee +++ b/app/coffeescripts/calendar/Calendar.coffee @@ -411,7 +411,7 @@ define [ originalEnd = fcUtil.clone(event.end) @copyYMD(event.start, date) @copyYMD(event.end, date) - @_eventDrop(event, 0, false, => + @_eventDrop(event, moment.duration(event.start.diff(originalStart)).asMinutes(), false, => event.start = originalStart event.end = originalEnd @updateEvent(event) diff --git a/spec/selenium/calendar/calendar2_month_spec.rb b/spec/selenium/calendar/calendar2_month_spec.rb index 03585b42232..ced9e17cdf9 100644 --- a/spec/selenium/calendar/calendar2_month_spec.rb +++ b/spec/selenium/calendar/calendar2_month_spec.rb @@ -85,6 +85,7 @@ describe "calendar2" do @initial_time = Time.zone.parse('2015-1-1').beginning_of_day + 9.hours @initial_time_str = @initial_time.strftime('%Y-%m-%d') @one_day_later = @initial_time + 24.hours + @one_day_later_str = @one_day_later.strftime('%Y-%m-%d') @three_days_earlier = @initial_time - 72.hours end @@ -206,6 +207,22 @@ describe "calendar2" do extended_day_text = format_time_for_view(date_of_next_day.to_datetime + 1.day) expect(f('.event-details-timestring .date-range').text).to eq("#{original_day_text} - #{extended_day_text}") end + + it "allows dropping onto the minical" do + # fullcalendar drop onto minical doesn't work under webpack. We should figure out why... + pending("fullcalendar drop onto minical doesn't work under webpack") if CANVAS_WEBPACK + + event = make_event(start: @initial_time) + load_month_view + quick_jump_to_date(@initial_time_str) + + drag_and_drop_element(f('.calendar .fc-event'), fj("#minical .fc-day-number[data-date=#{@one_day_later_str}]")) + keep_trying_until { fj("#minical .fc-bg .fc-day.event[data-date=#{@one_day_later_str}]") } + wait_for_ajaximations + + event.reload + expect(event.start_at).to eq(@one_day_later) + end end it "more options link should go to calendar event edit page" do