fullcalendar-columns icon indicating copy to clipboard operation
fullcalendar-columns copied to clipboard

Not working with fullcalendar 2.5.0

Open kabus202 opened this issue 9 years ago • 6 comments

Hi,

I have a problem using this with fullcalendar 2.5.0

<!DOCTYPE html>

kabus202 avatar Jan 01 '16 18:01 kabus202

Hi kabus, thanks for letting me know. I am using v2.3.x in production and currently don't have time to upgrade to 2.5.0. If you want to submit a Pull Request that adds compatibility with v2.5.0 while maintaining compatibility with 2.3.x, I'd be happy to accept it!

mherrmann avatar Jan 03 '16 15:01 mherrmann

It's crashing in 2.6.0 as well. fullcalendar-columns.js:20 Uncaught TypeError: Cannot read property 'views' of undefined

which then crash in fullcalendar.js:8563 itself: TypeError: spec.class is not a function

Here's my coffeescript (just for test)

$(document).ready ->
  today = new Date()
  today.setHours(0,0,0,0)

  $("#calendar").fullCalendar(
    weekends: false # hide saturdays / sundays
    editable: true
    selectable: true
    lang: "fr"
    timezone: 'local'
    header:
      left: 'prev,next today'
      center: 'title'
      right:'month,multiColWeek,agendaDay'

    views:
      multiColWeek:
        type: 'multiColAgenda'
        duration:
          weeks : 1
        numColumns: 5
        columnHeaders : ['- 1 -','- 2 -','- 3 -','- 4 -','- 5 -']



    defaultView: 'multiColWeek'        #'agendaWeek'
    height: "auto"
    slotMinutes: 30
    aspectRatio: 2
    allDaySlot: false
    minTime: "07:00:00"
    maxTime: "21:30:00"
    nowIndicator: true
    timeFormat: 'HH:mm'
    columnFormat: 'dddd D/MM'
    titleFormat: 'D MMMM YYYY'
    dragOpacity: "0.5"
    eventConstraint:
      start: '07:00'
      end: '21:00'
`

Trebor777 avatar Feb 04 '16 14:02 Trebor777

@Trebor777 : Are you sure you added the fullcalendar-columns.js after the fullcalendar.js? I could reproduce your error. @kabus202 :I can confirm that it crashes with version greater 2.5. However, I think I found a rather simple workaround. You simply need to add minTime and maxTime and it should stop crashing. However I didn't further test anything, so there might be some other issues that I'm not aware of. Here is a fiddle that is working with version 2.5: http://jsfiddle.net/rzy9yqvf/6/

Furthermore, i just realised that #13 is also related to version >= 2.5. (As you can see in the fiddle). I'm currently rather busy, so I cannot look into it right now. @mherrmann I know you are quite busy too, but I guess that for someone familiar with the code, it should be fixable in a couple minutes (probably by adjusting the "_monkeyPatchGridRendering" function). Hopefully you find some time.

mitomm avatar Mar 10 '16 13:03 mitomm

Thank you for taking the time to help out with this @mitomm. The minTime / maxTime fix is actually quite cool. I'm not sure I should still support fullcalendar-columns for newer versions of FC since there is now an official plugin that provides the same functionality. I only maintain fullcalendar-columns because I still use it in production (with FC 2.3.1) but for new projects I would recommend anyone to use the new plugin(?)

mherrmann avatar Mar 11 '16 09:03 mherrmann

(And as you said I'm quite busy and fullcalendar-columns is not a top priority for me now. But I'm happy to accept pull requests like yours @mitomm, that don't break compatibility with 2.3.x. Thanks again for that btw!)

mherrmann avatar Mar 11 '16 09:03 mherrmann

@mherrmann yes, I also saw the "official plugin", however, as it is part of the bigger "scheduler" plugin of fullcalendar, it is not free to use. Thus, fullcalendar-columns is still a great alternative. That's why I think it would be quite a pity not supporting newer versions. No worries for the PR, your columns already helped me tremendously.

mitomm avatar Mar 11 '16 10:03 mitomm