2016-10-19 46 views
1

月、週、曜日、およびリストビューのオプションでFullCalendarを設定しようとしていますが、これはほとんどの場合ほぼ正常です。FullCalendar - リストビューの複数日のイベントが正しくグループ化されていない

FullCalendar working fine for MonthView

しかし、リストビューでは、複数日のイベントだ最初のイベントが開始日と終了日の間に、他のEVENTOでグループ化されていません。

Events not grouping correctly at the days

私がしようとしています共同利用デ・その下に私はこの問題の答えから取得:fullCalendar multi-day event start and end times(私は答えるか、そこにコメントするのに十分な評判を持っていないので、私はこの新しいものを作成しています)

events.push({ 
 
    title: "Birmingham Comic Con", 
 
    start: new Date('2016-11-20T09:00'), 
 
    end: new Date('2016-11-22T19:00'), 
 
    id: 1, 
 
    isMultipleDay: true, 
 
    multipleDayEvents: [ 
 
    { 
 
     start: new Date('2016-11-20T09:00'), 
 
     end: new Date('2016-11-20T19:00'), 
 
     allDay: false, 
 
     description: 'Day 1', 
 
    }, 
 
    { 
 
     start: new Date('2016-11-21T09:00'), 
 
     end: new Date('2016-11-20T19:00'), 
 
     allDay: false, 
 
     description: 'Day 2' 
 
    }, 
 
    { 
 
     start: new Date('2016-11-22T09:00'), 
 
     end: new Date('2016-11-22T19:00'), 
 
     allDay: false, 
 
     description: 'Day 3' 
 
    } 
 
    ] 
 
}); 
 
events.push({ 
 
    title: "Birmingham Comic Con Outro", 
 
    start: new Date('2016-11-20T10:00'), 
 
    end: new Date('2016-11-20T19:00'), 
 
    id: 2 
 
}); 
 
events.push({ 
 
    title: "Birmingham Comic Con No meio", 
 
    start: new Date('2016-11-21T10:00'), 
 
    end: new Date('2016-11-21T19:00'), 
 
    id: 3 
 
});

これがいっぱいですコード:

$(document).ready(function() { 
 
    moment.locale(idioma); 
 
    var today = moment(Date()).format("YYYY-MM-DD"); 
 
    var status = ''; 
 
    var vencimento = ''; 
 
    var description = ''; 
 
    var action = ''; 
 
    var setColor = ''; 
 

 
    $('#calendar').fullCalendar({ 
 
     header: { 
 
      left: 'prev,next today', 
 
      center: 'title', 
 
      right: 'month,agendaWeek,agendaDay,listMonth' 
 
     }, 
 
     defaultDate: today, 
 
     defaultView: 'month', 
 
     listDayFormat: 'dddd', 
 
     listDayAltFormat: 'LL', 
 
     locale: 'en', 
 
     editable: false, 
 
     eventLimit: true, // allow "more" link when too many events 
 
     events: function (start, end, timezone, callback) { 
 
      jQuery.ajax({ 
 
       url: window.root + "Calendarios/GetEvents", 
 
       type: 'POST', 
 
       dataType: 'json', 
 
       data: { 
 
        start: start.format(), 
 
        end: end.format(), 
 
        agendado: $("#Agendado").is(":checked"), 
 
        realizado: $("#Realizado").is(":checked"), 
 
        atrasado: $("#Atrasado").is(":checked") 
 
       }, 
 
       success: function (data) { 
 
        var events = []; 
 
        /* 
 
        if (data.Success) { 
 
         $.map(data.Treinamentos, function (t) { 
 
          if (t.Status == 2) { 
 
           setColor = "green"; 
 
          } else { 
 
           if (t.Status == 1 && (moment() > moment(t.DataFinal))) 
 
            setColor = "red"; 
 
           else 
 
            setColor = ""; 
 
          } 
 

 
          t.Participantes.forEach(function (item) { 
 
           if (item.Status == 2) { 
 
            setColor = "green"; 
 
           } else { 
 
            if (t.Status == 1 && (moment() > moment(t.DataFinal))) 
 
             setColor = "red"; 
 
            else 
 
             setColor = ""; 
 
           } 
 

 
           events.push({ 
 
            id: item.Id, 
 
            title: item.Funcionario.Registration + " - " + item.Funcionario.Name, 
 
            start: moment(t.DataInicial).format("YYYY-MM-DDTHH:mm:ss"), 
 
            end: moment(t.DataFinal).format("YYYY-MM-DDTHH:mm:ss"), 
 
            color: setColor, 
 
            description: t.InfoCardNumber + " - " + t.Revision, 
 
            url: window.root + "Treinamentos/Index/" + t.Id 
 
           }); 
 
          }); 
 
         }); 
 
        } 
 
        */ 
 
        events.push({ 
 
         title: "Birmingham Comic Con", 
 
         start: new Date('2016-11-20T09:00'), 
 
         end: new Date('2016-11-22T19:00'), 
 
         id: 1, 
 
         isMultipleDay: true, 
 
         multipleDayEvents: [ 
 
          { 
 
           start: new Date('2016-11-20T09:00'), 
 
           end: new Date('2016-11-20T19:00'), 
 
           allDay: false, 
 
           description: 'Day 1', 
 
          }, 
 
          { 
 
           start: new Date('2016-11-21T09:00'), 
 
           end: new Date('2016-11-20T19:00'), 
 
           allDay: false, 
 
           description: 'Day 2' 
 
          }, 
 
          { 
 
           start: new Date('2016-11-22T09:00'), 
 
           end: new Date('2016-11-22T19:00'), 
 
           allDay: false, 
 
           description: 'Day 3' 
 
          } 
 
         ] 
 
        }); 
 
        events.push({ 
 
         title: "Birmingham Comic Con Outro", 
 
         start: new Date('2016-11-20T10:00'), 
 
         end: new Date('2016-11-20T19:00'), 
 
         id: 2 
 
        }); 
 
        events.push({ 
 
         title: "Birmingham Comic Con No meio", 
 
         start: new Date('2016-11-21T10:00'), 
 
         end: new Date('2016-11-21T19:00'), 
 
         id: 3 
 
        }); 
 
        callback(events); 
 
       } 
 
      }); 
 
     }, 
 
     eventRender: function (event, element) { 
 
      element.popover({ 
 
       title: event.title, 
 
       placement: "auto", 
 
       html: true, 
 
       trigger: "click", 
 
       animation: "true", 
 
       content: event.description, 
 
       container: "body" 
 
      }); 
 
     }, 
 
     eventMouseout: function (event, jsEvent, view) { 
 
      $(this).popover("hide"); 
 
     }, 
 
     eventMouseover: function (event, jsEvent, view) { 
 
      $(this).popover("show"); 
 
     } 
 
    }); 
 

 
    //Botão Mostrar Filtro 
 
    $("#BtShowFilter").html(ShowFilter); 
 
    $("#BtShowFilter").on("click", function() { 
 
     $("#Filter").slideToggle(function() { 
 
      var text = $("#Filter").css("display") === "none" ? ShowFilter : HideFilter; 
 
      $("#BtShowFilter").html(text); 
 
     }); 
 

 
    }); 
 

 
    //Botão Filtro 
 
    $("#BtFilter").on("click", function() { 
 
     $('#calendar').fullCalendar("refetchEvents"); 
 
    }); 
 

 
});

答えて

1

私が実際にしました同じ問題を扱っている。私はFullCalendar(3.0.1)の最新リリースに移行することで修正できました。彼らはリストビューでこのバグを修正しました。少なくとも、私の問題を処理しました。あなたとまったく同じように見えます。

リリースノート:https://github.com/fullcalendar/fullcalendar/releases/tag/v3.0.1

が、これはあまりにもあなたの問題を修正ホープ!

関連する問題