The error Uncaught TypeError: Cannot read property '_calendar' of undefined when implementing in fullcalendar-rails gem.

Asked 1 years ago, Updated 1 years ago, 72 views

I have implemented it by referring to the code below.
https://github.com/siguremon/calendarclone/blob/master/app/assets/javascripts/calendar.js

However, due to the old version, the following version is available locally.

ruby2.2.2p95
rails 4.2.5

The calendar was displayed and I was able to enter the title on the modal screen, but when I pressed OK,

Uncaught TypeError: Cannot read property '_calendar' of undefined

The error occurs:

The file from which the error originated is as follows in moment.js.

    function locale_calendar_calendar(key, mom, now){
        var output = this._calendar [key]; // ← Where the error occurred
        return type of output === 'function'?output.call(mom, now): output;
    }

Moment.js is a gem part, so I'm not playing with anything.

When I looked into various things, I found that the following symptoms
br/> https://stackoverflow.com/questions/24436574/fullcalendar-v2-error-uncaught-typeerror-cannot-read-property-month-of-undef

event.start.format()
start.format()

I put in the format like this, but it didn't work.

Also, I tried to comment out the part of the gem at the wrong time, but then I stopped doing this because there was an error in another part.

Cannot read property '_longDateFormat' of undefined

I don't know how to debug the external library (moment.js) and
We are at a loss for this solution.

Can someone give me some advice?

Thank you for your cooperation.

javascript ruby-on-rails ruby rubygems

2022-09-30 21:14

1 Answers

https://fullcalendar.io/docs/event_data/events_function/

The error was resolved using start.unix().For your information,


2022-09-30 21:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.