jquery Full Calendarを使用しようとしています
特定の時点でユーザーがいる現在の月を取得する方法が見つかりませんでした。
レンダリングでは、タイトルで現在の月として設定されますが、その情報を使用する方法が見つかりません。追加のパラメーター (開始、終了、_) と一緒に ajax 呼び出しに月を送信したいのですが、方法がわかりません。
定義内で、fullcalendar
現在表示されている月を取得するにはどうすればよいですか?
jquery Full Calendarを使用しようとしています
特定の時点でユーザーがいる現在の月を取得する方法が見つかりませんでした。
レンダリングでは、タイトルで現在の月として設定されますが、その情報を使用する方法が見つかりません。追加のパラメーター (開始、終了、_) と一緒に ajax 呼び出しに月を送信したいのですが、方法がわかりません。
定義内で、fullcalendar
現在表示されている月を取得するにはどうすればよいですか?
応答が本当に遅くなってすみません。これがあなたが望むものです:http: //arshaw.com/fullcalendar/docs/current_date/getDate/
以下は、現在の月を長い形式で示していますが、他の多くの形式を返すことができます: http://arshaw.com/fullcalendar/docs/utilities/formatDate/
var curDate = $('#calendar').fullCalendar('getDate');
alert("The current month of the calendar is " + $.fullCalendar.formatDate(curDate, "MMMM")); // Corrected the typo of currDate to curDate but thanks :)
$('#calendar').fullCalendar('addEventSource', function (start, end, callback) {
date = new Date(start);
alert(date.getMonth());
$.ajax({
type: 'POST',
url: '/Employee/GetScheduleDetailedArray/',
async: false,
dataType: "json",
data: {
// our hypothetical feed requires UNIX timestamps
start: start,
end: end,
id: 1,
currentDate: $('#calendar').fullCalendar('getDate'),
currentMonth: date.getMonth()
},
success: function (doc) {
callback(doc);
},
error: function (xhr, status, error) {
document.appendChild(xhr.responseText);
}
}); //end ajax
});
関数getMonth()は、月の整数を返します。