LoginSignup
2
1

More than 5 years have passed since last update.

FullCalendarの日・週単位表示で深夜帯の表示

Posted at

カレンダー機能を提供してくれるjQueryプラグインFullClendar(Ver2.7.3)で日単位表示(agendaDate)で深夜帯の予定を表示しようとしたところ、縦の時間軸はきちんと表示され、同日の午前0時以前から始まる予定は表示されるものの、午前0時を超えて始まる予定が表示されませんでした。
調べてみると、StackOverflowに

の記事があり、FullCalendarのバグとのこと。

さっそく元々あった答えのように、computeSegVerticalsを

        seg.top = this.computeDateTop(seg.start, this.colData[seg.col].day);
        seg.bottom = this.computeDateTop(seg.end, this.colData[seg.col].day);

と修正して実行みましたが、colDataが見つからないとエラーになってしまいます。

たぶん、バージョンが新しくなったため表現が変わったためと思い、コードに目を通して、

computeSegVerticals: function(segs) {
    var i, seg;
    for (i = 0; i < segs.length; i++) {
        seg = segs[i];
        var start = this.dayDates[seg.dayIndex];
        seg.top = this.computeDateTop(seg.start, start);
        seg.bottom = this.computeDateTop(seg.end, start);
    }
}

と修正。
これで、エラー無く午前0時を超えて始まる予定も表示できるようになりました。週単位表示(agendaWeek)でも表示できました。StackOverflowにもお返しの投稿をしておきました。

まだ確認していませんが最新の2.9.0でもcolDataは存在せずdayDatesが存在するという同様の状況なので、上記の措置で表示できるようになるのではないかと思います。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1