How to use @fullcalendar/interaction - 4 common examples

To help you get started, we’ve selected a few @fullcalendar/interaction examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fullcalendar / fullcalendar / packages / __tests__ / src / event-drag / from-external.js View on Github external
it('should yield an event with an end', function(done) {
      initCalendar({
        defaultView: 'dayGridMonth',
        defaultDate: '2019-04-01',
        droppable: true,
        defaultAllDayEventDuration: { days: 2 },
        eventReceive(arg) {
          expect(arg.event.end).toEqualDate('2019-04-04')
          done()
        }
      })

      thirdPartyDraggable = new Draggable($dragEl[0], {
        eventData: {}
      })

      $dragEl.simulate('drag', {
        end: getDayEl('2019-04-02')
      })
    })
  })
github fullcalendar / fullcalendar / packages / __tests__ / src / event-drag / from-external.js View on Github external
initCalendar({
      defaultView: 'dayGridMonth',
      defaultDate: '2019-04-01',
      droppable: true,
      defaultAllDayEventDuration: { days: 2 },
      eventAllow(dropInfo, draggedEvent) {
        expect(draggedEvent.id).toBe('a')
        expect(draggedEvent.title).toBe('hey')
        expect(draggedEvent.start).toBe(null)
        expect(draggedEvent.end).toBe(null)
        called = true
      }
    })

    thirdPartyDraggable = new Draggable($dragEl[0], {
      eventData: {
        id: 'a',
        title: 'hey'
      }
    })

    $dragEl.simulate('drag', {
      end: getDayEl('2019-04-02'),
      callback() {
        expect(called).toBe(true)
        done()
      }
    })
  })
github fullcalendar / fullcalendar / packages / __tests__ / src / legacy / external-dnd.js View on Github external
plugins: [ InteractionPlugin, TimeGridPlugin, DayGridPlugin ],
      defaultDate: '2014-08-23',
      defaultView: 'dayGridMonth',
      droppable: true
    }

    $('body').append(
      '<div style="width:200px" id="sidebar">' +
        '<a class="fc-event event1">event 1</a>' +
        '<a class="fc-event event2">event 2</a>' +
      '</div>' +
      '<div style="width:600px;position:absolute;top:10px;left:220px" id="cal">' +
      '</div>'
    )

    thirdPartyDraggable = new ThirdPartyDraggable({
      itemSelector: '#sidebar .fc-event'
    })
  })
github fullcalendar / fullcalendar / packages / __tests__ / src / legacy / external-dnd-advanced.js View on Github external
beforeEach(function() {
    dragEl = $('<div class="drag">yo</div>')
      .css({
        width: 200,
        background: 'blue',
        color: 'white'
      })
      .appendTo('body')
      .draggable()

    thirdPartyDraggable = new ThirdPartyDraggable({
      itemSelector: '.drag'
    })
  })

@fullcalendar/interaction

Calendar functionality for event drag-n-drop, event resizing, date clicking, and date selecting

MIT
Latest version published 4 months ago

Package Health Score

84 / 100
Full package analysis