2015-01-29 3 views
1

jQuery 플러그인을 사용하고 있습니다. Fullcalendar 지금까지 데이터베이스 MySQL에 저장된 데이터를 표시 할 수 있었지만 올바르게 표시되지 않았습니다. 내 말은 다음과 같습니다Fullcalendar 9시 이전에 이벤트가 표시되지 않습니다.

예컨대 :

} 
    "id":"1","title":"Test", 
    "start":"2015-01-28 10:30:00", 
    "end":"2015-02-04 12:30:00", 
    "url":"", 
    "allDay":"false" 
} 

이 내 데이터베이스에서 하나 개의 레코드입니다. 내 캘린더에 표시해야합니다.

2015-01-28 10:30:00 ~ 2015-02-04 12:30:00.

하지만 그렇지 않습니다. 대신 allDaytrue (데이터베이스에 있다고해도 false라고 말하면서) 다른 날도 추가해야합니다.

예 : 16-03에서 17-03 사이의 날짜를 표시하려면 다른 날짜를 추가해야합니다 (예 : 16-03에서 18-03으로) (16-03에서 17-03으로 표시되도록).).

9시 이후에 레코드를 넣으면 "박스"이벤트 또는 div이 올바른 날짜까지 확장됩니다. 다른 현명한 그것은 올바른 날짜까지 확장되지 않습니다.

기본적으로 businessHoursfalse입니다. (나는 심지어 추가했다 : businessHours: false) 그러나 성공 없음.

이 내 SELECT 쿼리입니다 :

<?php 
$json = array(); 

// Query that retrieves events 
$querySQL = "SELECT * FROM evenement"; 
// connection to the database 
try { 
    $bdd = new PDO("mysql:host=localhost;dbname=dbcontrol", "root", ""); 
} catch(Exception $e) { 
    exit('Unable to connect to database.'); 
} 
// Execute the query 
$result = $bdd->query($querySQL) or die(print_r($bdd->errorInfo())); 

// sending the encoded result to success page 
    echo json_encode($result->fetchAll(PDO::FETCH_ASSOC)); 
?> 

그리고 이것은 내 jQuery입니다 :

$(document).ready(function() { 
    var currentTime = new Date(); 
     /* initialize the external events 
     -----------------------------------------------------------------*/ 

     $('#external-events .fc-event').each(function() { 

      // store data so the calendar knows to render an event upon drop 
      $(this).data('event', { 
       title: $.trim($(this).text()), // use the element's text as the event title 
       stick: true // maintain when user navigates (see docs on the renderEvent method) 
      }); 

      // make the event draggable using jQuery UI 
      $(this).draggable({ 
       zIndex: 999, 
       revert: true,  // will cause the event to go back to its 
       revertDuration: 0 // original position after the drag 
      }); 

     }); 


     /* initialize the calendar 
     -----------------------------------------------------------------*/ 

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

      eventBackgroundColor: '#A80000', 
      eventBorderColor: '#A80000', 

      eventLimit: true, // allow "more" link when too many events 
      events: { 
       url: './php/select-events.php', 
       error: function() { 
        $('#script-warning').show(); 
       } 
      }, 
      loading: function(bool) { 
       $('#loading').toggle(bool); 
      } 
     }); 

    }); 
+0

시작 및 끝 형식이 올바르지 않습니다. fullcalendar 설명서를 확인하고 조정 해보십시오. – Asik

답변

0

문제 ->"allDay":"false"

allDay 부울 값이 있어야하지 문자열 "거짓 ". "allDay":false으로 변경하면 효과가 있습니다.

관련 문제