バックエンドへのデータパスは間違っていないと思います..データが渡されます..
eventSources:
[
// your event source
{
url: '/ajax-load-holidays',// use the `url` property
type: 'POST',
datatype: "JSON",
data : function()
{ // a function that returns an object
var date = new Date($('#calendar').fullCalendar('getDate'));
month_integer = date.getMonth();
year_integer = date.getFullYear();
return {
month: month_integer,
year: year_integer
}
},
error: function() {
alert('there was an error while fetching eventsin hol!');
},
color: 'yellow', // a non-ajax option
textColor: 'blue' // a non-ajax option
},
],
eventRender: function(event, element, view) {
// lets test if the event has a property called holiday.
// If so and it matches '1', change the background of the correct day
if (event.holiday == '1') {
var dateString1 = event.start.format("YYYY-MM-DD");
$(view.el[0]).find('.fc-day[data-date=' + dateString1 + ']')
.css('background-color', '#FAA732','.fc-time','disable');
}
}
//これは私のコントローラーです...これはlaravel(MVC-repository)で行いました
public function LoadHoliday(Request $request)
{
$this->year = $request['year'];
$month = $request['month'];
$month++;
$this->month=$month;
$Rowdata1 = ($this->holidayFixed->getValueMonth("monthOfTheYear",$this-month));
$Rowdata2 = $this->holidayMovable->getValueMonth("monthID",$this->month);
$x=0;
$data1[] = 0;
$data2[] = 0;
if($Rowdata1==null && $Rowdata2==null)
{
return 0;
}
else {
foreach($Rowdata1 as $value){
$mon = $value->monthOfTheYear;
$day = $value->dayOfTheMonth;
$dateD = $this->year. '-' . $mon . '-' . $day;
$data1[$x] = [
'title' => $value->description,
'start' => $dateD,
'holiday' => '1'
];
$x++;
}
foreach($Rowdata2 as $value){
$year = ($value->yearID);
$mon = $value->monthID;
$day = ($value->dateID);
$dateD = $year . '-' . $mon . '-' . $day;
$data2[$x] = [
'title' => $value->description,
'start' => $dateD,
'holiday' => '1'
];
$x++;
}
if($data1==['0'] && $data2==['0'])
{
return 0;
}
elseif($data1==['0'])
{
return $data2;
}
elseif($data2==['0'])
{
return $data1;
}
else
{
unset($data2['0']);
$data3 = array_merge($data1, $data2);
return $data3;
}
}
}