私はフルカレンダーを使用して月に生徒の出席を表示しています。前のボタンのデータを正しくクリックしても、値はカレンダーに表示されません。私は、コンソールで日付を表示することができますが、カレンダー前のボタンでカレンダーのデータが完全に表示されない
$(document).on("click", ".fc-prev-button", function() {
getMonth();
});
$(document).on("click", ".fc-next-button", function() {
getMonth();
});
function getMonth() {
var date = $('div[id*=calendar1]').fullCalendar('getDate');
date = date.format('YYYY-MM-DD');
alert(date);
$('div[id*=calendar1]').fullCalendar({
header: {
left: 'prev,next today myCustomButton',
center: 'title',
right: 'month,agendaWeek,agendaDay'
}
});
$.ajax({
type: "POST",
contentType: "application/json",
data: "{Date:'" + date + "'}",
url: "attendance-full.aspx/GetEvents",
dataType: "json",
success: function (data) {
alert("Done");
console.log(data);
events: $.map(data.d, function (item, i) {
var event = new Object();
event.id = item.EventID;
event.start = new Date(item.StartDate);
event.title = item.EventName;
return event;
})
$("#calendar1").fullCalendar("refetchEvents");
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
debugger;
}
});
}
@ Dont't Panic最初の日付を開始日と最後の日付を最後に渡すことはできますか?あなたのサポートをありがとう私は完全な暦の初心者です – Jks
@Jks私はあなたが何を意味するのか分かりません。 Fullcalendarは、現在表示されている範囲に対して自動的に 'start'と' end'を渡します。ブラウザのデベロッパーツールを開き、ネットワークタブを見てください。Fullcalendarが何をしているのか、そして月/ビューを変更したときに渡すパラメータが表示されます。 –
は、ユーザーが指定した値を渡すことができます。たとえば、10/09/2017 -15/09/2017の間の値、私は十分な評判がないので、私はあなたのために投票できません – Jks