rem: if (calendarEvent.recur) { var now = new Date(); var result = new Object(); var dur = calendarEvent.endDate.jsDate - calendarEvent.startDate.jsDate; 
add: var dur = calendarEvent.duration.clone(); dur.isNegative = true; 
context: function getCurrentNextOrPreviousRecurrence(calendarEvent){    var isValid = false;    var eventStartDate;    if (calendarEvent.recur) {        var now = new Date();        var result = new Object();        var dur = calendarEvent.endDate.jsDate - calendarEvent.startDate.jsDate;        // To find current event when now is during event, look for occurrence        // starting duration ago.        var probeTime = now.getTime() - dur;        isValid = calendarEvent.getNextRecurrence(probeTime, result);        if (isValid) {            eventStartDate = new Date(result.value);        } else {            isValid = calendarEvent.getPreviousOccurrence(probeTime, result);            if (isValid) {                eventStartDate = new Date(result.value);            }        }    }       if (!isValid) {        eventStartDate = new Date( calendarEvent.startDate.jsDate );    }          return eventStartDate;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/4ad990f6ab769f8c04e568749e60021abed672ca/calendarUtils.js/buggy/calendar/resources/content/calendarUtils.js