Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with fullcalendar 2.5.0 #17

Open
kabus202 opened this issue Jan 1, 2016 · 6 comments
Open

Not working with fullcalendar 2.5.0 #17

kabus202 opened this issue Jan 1, 2016 · 6 comments

Comments

@kabus202
Copy link

kabus202 commented Jan 1, 2016

Hi,

I have a problem using this with fullcalendar 2.5.0

<!DOCTYPE html>
<script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.js'></script> <script src='https://code.jquery.com/jquery-2.1.3.js'></script> <script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.js'></script> <script src='../js/plugin/fullcalendar/fullcalendar-columns.js'></script> <script> $(document).ready(function() {
        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'multiColAgendaDay,multiColAgendaWeek'
            },
            views: {
                multiColAgendaDay: {
                    type: 'multiColAgenda',
                    duration: { days: 1 },
                    numColumns: 2,
                    columnHeaders: ['First Column', 'Second Column']
                },
                multiColAgendaWeek: {
                    type: 'multiColAgenda',
                    duration: { weeks: 1 },
                    numColumns: 2,
                    columnHeaders: ['First', 'Second']
                }
            },
            allDaySlot: false,
            defaultView: 'multiColAgendaDay',
            defaultDate: '2015-02-12',
            editable: true,
            events: [
                {
                    title: 'Meeting 1',
                    start: '2015-02-12T10:30:00',
                    end: '2015-02-12T12:30:00',
                    column: 0
                },
                {
                    title: 'Meeting 2',
                    start: '2015-02-12T10:30:00',
                    end: '2015-02-12T12:30:00',
                    column: 1
                }
            ]
        });

    });
</script>
<style>
    body {
        margin: 40px 10px;
        padding: 0;
        font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
        font-size: 14px;
    }
    #calendar {
        max-width: 900px;
        margin: 0 auto;
    }
</style>
@mherrmann
Copy link
Owner

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!

@Trebor777
Copy link

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'
`

@mitomm
Copy link

mitomm commented Mar 10, 2016

@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.

@mherrmann
Copy link
Owner

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
Copy link
Owner

(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!)

@mitomm
Copy link

mitomm commented Mar 11, 2016

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants