问题描述:

I'm trying to change the language of a fullcalendar dynamically depending of the language selected in my interface. the dropdown which change the language is associated to a factory and to get the changed value I use a watch:

$scope.$watch(function() {

return langFctr.selectedLang;

},

function(newValue, oldValue) {

if (oldValue != newValue) {

$scope.selectedLang = newValue;

$('#calendar').fullCalendar('option', 'lang', $scope.selectedLang);

}

}

);

but the language didn't change in the fullcalendar this is my code

网友答案:

To use other languages of the FullCalendar,you must first include the language's js.These files are included in the lang/ directory.Now the files that you have included must be loaded via script.

For example,to include the es script use :-

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

Now use the following snippet all inside a script tag :-

    $(document).ready(function(){
            $('#calendar').fullcalendar({
                        lang:'es'
                          });
                        });
相关阅读:
Top