для AJAX его работа для меня
// get time in php file
var set_calendar_time = $('#calendar_time').val();
var initialLocaleCode = 'en';
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listMonth'
},
isJalaali : true,
defaultDate: set_calendar_time,//'2018-03-12',
locale: initialLocaleCode,
buttonIcons: false, // show the prev/next text
weekNumbers: true,
navLinks: true, // can click day/week names to navigate views
editable: false,
eventLimit: false, // allow "more" link when too many events
events: {
url: 'http://127.0.0.1/get-events.php',
error: function() {
$('#script-warning').show();
},
success: function(){
// not clear
}
},
loading: function(bool) {
$('#loading').toggle(bool);
},
eventRender: function eventRender( event, element, view ) {
return ['all', event.school].indexOf($('#school_selector').val()) >= 0 // (event.nameitem)
}
});
$('#school_selector').on('change',function(){
$('#calendar').fullCalendar('rerenderEvents');
})
// build the locale selector's options
$.each($.fullCalendar.locales, function(localeCode) {
$('#locale-selector').append(
$('<option/>')
.attr('value', localeCode)
.prop('selected', localeCode == initialLocaleCode)
.text(localeCode)
);
});
// when the selected option changes, dynamically change the calendar option
$('#locale-selector').on('change', function() {
if (this.value) {
$('#calendar').fullCalendar('option', 'locale', this.value);
$('#calendar').fullCalendar('option', 'isJalaali', (this.value == 'fa' ? true : false));
}
});
// HTML
<div id='top'>
<div class='selector'>
<div id='script-warning'>
<code>get-events</code> error.
</div>
<div id='loading'>loading...</div>
</div>
<div class='selector'>
<select id='locale-selector'></select>
</div>
<div class='selector'>
<select id='school_selector'>
<option value='all'>all</option>
<option value='1'>School 1</option>
<option value='2'>School 2</option>
</select>
</div>
</div>";