2013-04-29 2 views
0

http://arshaw.com/fullcalendar/에서 Fullcalendar를 사용하고 있습니다. 검색 stackoverflow가 있지만 내 문제에 맞는 답이 없습니다. 그렇지 않습니다. 이미 답변 한 경우 링크를 붙여 넣으십시오.Fullcalendar 일정보기 및 날짜 이벤트가 특정 시간 (시간) 내에 이벤트를 렌더링하지 않습니다.

이벤트 예 :

<event allDay="false" editable="true" end="Mon Apr 29 2013 15:30:00 GMT+0100" id="53" start="Mon Apr 29 2013 08:30:00 GMT+0100" title="tesete"/> 

당신은 시작과 끝 하루가 나는 경우

는 시간 형식은 다음과 같이 저장된

나는 이벤트를 반환하는 XML 파일이 있습니다.

난과 같이 이벤트를 가져올 때 :

events: function(start, end, callback) { 
      $.ajax({ 
       type: 'POST', 
       url: url, 
       dataType:'xml', 
       crossDomain: true, 
       data: { 
        // our hypothetical feed requires UNIX timestamps 
        start: Math.round(start.getTime()/1000), 
        end: Math.round(end.getTime()/1000),      
        'ajax':true, 
        'acc':'2',      
       }, 
       success: function(doc) {        
        var events = []; 
        $(doc).find('event').each(function() 
        { 
         events.push({ 
          id: $(this).attr('id'), 
          title: $(this).attr('title'), 
          start: $(this).attr('start'), 
          end: $(this).attr('end'), 
          allDay: $(this).attr('allDay'), 
          editable: $(this).attr('editable') 
         });        
        });          
        callback(events); 
       } 
      });  
     }, 

모든 이벤트가 올바르게 월보기에 표시,하지만 난 agendaView 또는 dayView으로 전환하면, 이벤트가 올 데이 바 만, 그들은하지 않습니다 특정 시간 사이에 렌더링됩니다. 예를

에 대한 15 : 30

8 : 30
start="Mon Apr 29 2013 08:30:00 GMT+0100" end="Mon Apr 29 2013 15:30:00 GMT+0100" id="53" 

내가 무슨 말이냐? 이 문제에

해결책 :

events: function(start, end, callback) { 
      $.ajax({ 
       type: 'POST', 
       url: 'myurl', 
       dataType:'xml', 
       crossDomain: true, 
       data: { 
        // our hypothetical feed requires UNIX timestamps 
        start: Math.round(start.getTime()/1000), 
        end: Math.round(end.getTime()/1000),      
        'ajax':true, 
        'acc':'2',      
       }, 
       success: function(doc) {        
        var events = []; 
        var allday = null; //Workaround 
        $(doc).find('event').each(function() 
        {    

         if($(this).attr('allDay') == "false") //Workaround 
           allday = false; //Workaround 
         if($(this).attr('allDay') == "true") //Workaround 
           allday = true; //Workaround       

         events.push({ 
          id: $(this).attr('id'), 
          title: $(this).attr('title'), 
          start: $(this).attr('start'), 
          end: $(this).attr('end'),      
          allDay: allday, 
          editable: $(this).attr('editable') 
         });        
        });          
        callback(events); 
       } 
      });  
     }, 

답변

0

바르 올 데이 문자열이 아니어야합니다. 따옴표없이 allDay=false이어야합니다.

+0

예, 이것은 xml 파일의 이벤트이므로 속성 값은 실제로 값이되도록 따옴표 안에 있어야합니다. –

+0

문제는 저장되는 날짜 형식에 있다고 생각합니다. –

+0

당신이 바로 내 친구가 DUMM : 것에 대해, :) 당신을 유감 감사 던걸이 실제로 여기 awnseared되었다 http://stackoverflow.com/questions/9933373/formatting-events-date-and-time- on-fullcalender –