1

jquery Full Calendarを使用しようとしています

特定の時点でユーザーがいる現在の月を取得する方法が見つかりませんでした。

レンダリングでは、タイトルで現在の月として設定されますが、その情報を使用する方法が見つかりません。追加のパラメーター (開始、終了、_) と一緒に ajax 呼び出しに月を送信したいのですが、方法がわかりません。

定義内で、fullcalendar現在表示されている月を取得するにはどうすればよいですか?

4

3 に答える 3

1

応答が本当に遅くなってすみません。これがあなたが望むものです:http: //arshaw.com/fullcalendar/docs/current_date/getDate/

于 2010-04-09T01:54:31.610 に答える
1

以下は、現在の月を長い形式で示していますが、他の多くの形式を返すことができます: 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 :)
于 2012-06-09T14:22:28.813 に答える
0
     $('#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()は、月の整数を返します。

于 2011-09-29T14:27:20.677 に答える