2017-04-24 8 views
-1

Ich bin immer noch auf der Suche nach einer Antwort, warum mein Kalender nicht erscheint ... Ich arbeite an einem Multisite WordPress und möchte WP-Fullcalendar implementieren, aber ich denke, ich mache etwas falsch . Ich denke, wenn du in meinen Code guckst, wirst du vielleicht lachen, aber ich weiß nicht, warum mein Kalender nicht angezeigt wird. Vielen Dank für Ihre Hilfe! Grüße Wp-Fullcalendar wird nicht angezeigt

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<script src='http://fullcalendar.io/js/fullcalendar-2.1.1/lib/moment.min.js'></script> 
 
<script src='http://fullcalendar.io/js/fullcalendar-2.1.1/lib/jquery.min.js'></script> 
 
<script src="http://fullcalendar.io/js/fullcalendar-2.1.1/lib/jquery-ui.custom.min.js"></script> 
 
<script src='http://fullcalendar.io/js/fullcalendar-2.1.1/fullcalendar.min.js'></script> 
 
<script> 
 

 
     $(document).ready(function() { 
 
      var date = new Date(); 
 
      var d = date.getDate(); 
 
      var m = date.getMonth(); 
 
      var y = date.getFullYear(); 
 

 
      var calendar = $('#calendar').fullCalendar({ 
 
       editable: true, 
 
       header: { 
 
        left: 'prev,next today', 
 
        center: 'title', 
 
        right: 'month,agendaWeek,agendaDay' 
 
       }, 
 

 
       events: [ 
 
\t \t \t \t { 
 
\t \t \t \t \t title: 'All Day Event', 
 
\t \t \t \t \t start: '2017-04-01' 
 
\t \t \t \t }, 
 
\t \t \t \t { 
 
\t \t \t \t \t title: 'Long Event', 
 
\t \t \t \t \t start: '2017-04-07', 
 
\t \t \t \t \t end: '2017-04-10' 
 
\t \t \t \t }, 
 
\t \t \t \t { 
 
\t \t \t \t \t id: 999, 
 
\t \t \t \t \t title: 'Repeating Event', 
 
\t \t \t \t \t start: '2017-04-09T16:00:00' 
 
\t \t \t \t }, 
 
\t \t \t \t { 
 
\t \t \t \t \t id: 999, 
 
\t \t \t \t \t title: 'Repeating Event', 
 
\t \t \t \t \t start: '2017-04-16T16:00:00' 
 
\t \t \t \t } 
 
\t \t \t ], 
 

 
       // Convert the allDay from string to boolean 
 
       eventRender: function(event, element, view) { 
 
        if (event.allDay === 'true') { 
 
         event.allDay = true; 
 
        } else { 
 
         event.allDay = false; 
 
        } 
 
       }, 
 
       selectable: true, 
 
       selectHelper: true, 
 
       select: function(start, end, allDay) { 
 
        var title = prompt('Event Title:'); 
 
        var url = prompt('Type Event url, if exits:'); 
 
        if (title) { 
 
         var start = $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss"); 
 
         var end = $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss"); 
 
         $.ajax({ 
 
          url: 'event.php', 
 
          data: 'title='+ title+'&start='+ start +'&end='+ end +'&url='+ url , 
 
          type: "POST", 
 
          success: function(json) { 
 
           alert('Added Successfully'); 
 
          } 
 
         }); 
 
         calendar.fullCalendar('renderEvent', 
 
           { 
 
            title: title, 
 
            start: start, 
 
            end: end, 
 
            allDay: allDay 
 
           }, 
 
           true // make the event "stick" 
 
         ); 
 
        } 
 
        calendar.fullCalendar('unselect'); 
 
       }, 
 

 
       editable: true, 
 
       eventDrop: function(event, delta) { 
 
        var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss"); 
 
        var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss"); 
 
        $.ajax({ 
 
         url: 'event.php', 
 
         data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id , 
 
         type: "POST", 
 
         success: function(json) { 
 
          alert("Updated Successfully"); 
 
         } 
 
        }); 
 
       }, 
 
       eventResize: function(event) { 
 
        var start = $.fullCalendar.formatDate(event.start, "yyyy-MM-dd HH:mm:ss"); 
 
        var end = $.fullCalendar.formatDate(event.end, "yyyy-MM-dd HH:mm:ss"); 
 
        $.ajax({ 
 
         url: 'event.php', 
 
         data: 'title='+ event.title+'&start='+ start +'&end='+ end +'&id='+ event.id , 
 
         type: "POST", 
 
         success: function(json) { 
 
          alert("Updated Successfully"); 
 
         } 
 
        }); 
 

 
       } 
 

 
      }); 
 

 
     }); 
 

 
    </script> 
 
    <style> 
 

 
     body { 
 
      margin-top: 40px; 
 
      text-align: center; 
 
      font-size: 14px; 
 
      font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; 
 

 
     } 
 

 

 
     #calendar { 
 
      width: 900px; 
 
      margin: 0 auto; 
 
     } 
 

 
    </style> 
 
</head> 
 
<body> 
 
<div id='calendar'> ?></div> 
 
</body> 
 
</html>

Antwort

0

Sie laden zweimal jQuery. Entferne einen von ihnen und es sollte dein Problem lösen.