error in full calendar

-1

I have a complete calendar and when I change the language to Portuguese, it returns me this error. Uncaught TypeError: Can not read property 'defineLocale' of undefined

   $('#calendar').fullCalendar({
                header: {
                    left: 'prev,next today',
                    right: 'month,agendaWeek'
                },
                defaultView: 'month',
                viewRender: function (view) {
                    var title = view.title;
                    $(".taskElementCalendar").html(title);
                }
            });

            $(".taskElementPrev").click(function () {
                $("#calendar").fullCalendar('prev');
            });
            $(".taskElementNext").click(function () {
                $("#calendar").fullCalendar('next');
            });
            $(".taskElementToday").click(function () {
                $("#calendar").fullCalendar('today');
            })
    
asked by anonymous 14.11.2017 / 18:22

1 answer

0

Have you properly imported the specific locale?

According to the documentation:

  

How to use other locales

     

You will need to load the locale JavaScript data file in order to use   it These files are included with the FullCalendar download in the   locale / directory. They must be loaded via the tag after the   main FullCalendar library is loaded.

<script src='fullcalendar/fullcalendar.js'></script>
<script src='fullcalendar/locale/es.js'></script>
<script>

    $(document).ready(function() {

        $('#calendar').fullCalendar({
        });

    });

</script>

If you import the specific locale, you do not need to pass any option.

Now if you import the JS file that has all the locations, then you can put options locale when initializing fullCalendar.

It would look something like this:

<script src='fullcalendar/fullcalendar.js'></script>
<script src='fullcalendar/locale-all.js'></script>
<script>

    $(document).ready(function() {

        $('#calendar').fullCalendar({
            locale: 'es'
        });

    });

</script>

I hope I have helped. Any questions, just comment.

    
14.11.2017 / 18:32