views:

1026

answers:

1

Has anyone else had this problem? Here is some code:

$(document).ready(function() {
    $('#calendar').fullCalendar({
        editable: true,
        disableDragging: false,
        height: 400,
        weekMode: 'variable',
        defaultView: 'agendaDay',
        allDaySlot: false,
        weekends: false,
        minTime: 7,
        maxTime: 22,
        slotMinutes: 15,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        eventSources: [
        //US HOLIDAYS
        //TODO: Add entries for Alaska Day and Seward Day
                $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic')
        ],
        events: function(start, end, callback) {

            $.getJSON('<%= ResolveUrl("~/TimeSheet/fetchCalEvents") %>',
            {
                start: $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss"),
                end: $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss")
            },
            function(data) {
                if (data != null) {

                    var events = [];
                    $.each(data, function(i, data) {

                        //allDay = start.indexOf('T') == -1;

                        //if (allDay) {
                             //$.fullCalendar.addDays(end, -1); // make inclusive
                        //}
                        events.push({
                            id: data.ID,
                            title: data.TITLE,
                            start: new Date(parseInt(data.START.replace("/Date(", "").replace(")/", ""), 10)),
                            end: new Date(parseInt(data.END.replace("/Date(", "").replace(")/", ""), 10)),
                            allDay: false,
                            //location: entry['gd$where'][0]['valueString'],
                            //description: entry['content']['$t'],
                            //className: options.classN6ame,
                            editable: true
                        });


                    });

                    callback(events);

                } //END if (data != null)


            });

        },//........ lots more code here.


//MY FORM HEADER USED WHEN SUBMITTING A NEW CALENDAR ITEM TO THE DB:    
<% using (Ajax.BeginForm("newTimeEntry", "TimeSheet", new AjaxOptions() { UpdateTargetId = "newTimeEntry", OnComplete="timeSubmitComplete", OnSuccess = "enableTimePickers", InsertionMode = InsertionMode.Replace }, new { id = "TimeEntry" }))



//##########################################
//CALLED AFTER SUCCESSFUL TIME ENTRY SUBMISSION
//RELOADS THE CALENDAR EVENTS
function timeSubmitComplete() {
    $('#calendar').fullCalendar('refetchEvents');
}
A: 

Well, of course....IE and its caching... I added the following to the get request for the events function. It adds a date parameter so the GET url changes each and every call to the server:

events: function(start, end, callback) {

            $.getJSON('<%= ResolveUrl("~/TimeSheet/fetchCalEvents") %>',
            {
                start: $.fullCalendar.formatDate(start, "yyyy-MM-dd HH:mm:ss"),
                end: $.fullCalendar.formatDate(end, "yyyy-MM-dd HH:mm:ss"),
                noCache: new Date()
            },
dpfresh