aboutsummaryrefslogblamecommitdiffstats
path: root/library/fullcalendar/examples/external-dragging-2cals.html
blob: a0744b24c51dd0947b2a73132f9650b000cfc6e4 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12



                        
                                               






                                                                         
                     
                                


                          

                                       


                          

                                       







                                                                  
                                



































                                                              
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<script src='../dist/index.global.js'></script>
<script>

  document.addEventListener('DOMContentLoaded', function() {
    var srcCalendarEl = document.getElementById('source-calendar');
    var destCalendarEl = document.getElementById('destination-calendar');

    var srcCalendar = new FullCalendar.Calendar(srcCalendarEl, {
      editable: true,
      initialDate: '2020-09-12',
      events: [
        {
          title: 'event1',
          start: '2020-09-11T10:00:00',
          end: '2020-09-11T16:00:00'
        },
        {
          title: 'event2',
          start: '2020-09-13T10:00:00',
          end: '2020-09-13T16:00:00'
        }
      ],
      eventLeave: function(info) {
        console.log('event left!', info.event);
      }
    });

    var destCalendar = new FullCalendar.Calendar(destCalendarEl, {
      initialDate: '2020-09-12',
      editable: true,
      droppable: true, // will let it receive events!
      eventReceive: function(info) {
        console.log('event received!', info.event);
      }
    });

    srcCalendar.render();
    destCalendar.render();
  });

</script>
<style>

  body {
    margin: 20px 0 0 20px;
    font-size: 14px;
    font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  }

  #source-calendar,
  #destination-calendar {
    float: left;
    width: 600px;
    margin: 0 20px 20px 0;
  }

</style>
</head>
<body>

  <div id='source-calendar'></div>
  <div id='destination-calendar'></div>

</body>
</html>