How to use the fullcalendar.Calendar.on function in fullcalendar

To help you get started, we’ve selected a few fullcalendar 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 / plugins / jquery-ui-draggable / main.ts View on Github external
import * as $ from 'jquery'
import { Calendar, ExternalDropping } from 'fullcalendar'

let $document = $(document)

Calendar.on('initialRender', function(calendar) {

  const handleDragStart = function(ev, ui) {

    const handleDragMove = (ev, ui) => {
      calendar.handleExternalDragMove(ev)
    }

    const handleDragStop = (ev, ui) => {
      calendar.handleExternalDragStop(ev)
      $document
        .off('drag', handleDragMove)
        .off('dragstop', handleDragStop)
    }

    $document
      .on('drag', handleDragMove)