rem:  var date; if (aStartTime) { date = aStartTime; } else { date = currentView().selectedDay.clone(); date.isDate = false; } createEventWithDialog(aCalendar, date, null); 
add: createEventWithDialog(aCalendar, aStartTime, null); 
context:     createNewEvent: function (aCalendar, aStartTime, aEndTime) {        // XXX If we're adding an item from the view, let's make sure that        // XXX the calendar in question is visible!        // XXX unify these        if (!aCalendar) {            if ("ltnSelectedCalendar" in window) {                aCalendar = ltnSelectedCalendar();            } else {                aCalendar = getSelectedCalendarOrNull();            }        }        // if we're given both times, skip the dialog        if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) {            var event = createEvent();            event.startDate = aStartTime;            event.endDate = aEndTime;            var sbs = Components.classes["@mozilla.org/intl/stringbundle;1"]                                .getService(Components.interfaces.nsIStringBundleService);            var props = sbs.createBundle("chrome://calendar/locale/calendar.properties");            event.title = props.GetStringFromName("newEvent");            setDefaultAlarmValues(event);            doTransaction('add', event, aCalendar, null, null);        } else if (aStartTime && aStartTime.isDate) {            var event = createEvent();            event.startDate = aStartTime;            setDefaultAlarmValues(event);            doTransaction('add', event, aCalendar, null, null);        } else {            // default pop up the dialog            var date;            if (aStartTime) {                date = aStartTime;            } else {                date = currentView().selectedDay.clone();                date.isDate = false;            }            createEventWithDialog(aCalendar, date, null);        }    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3c40dad8dceb1ae719d0a2ab881042cf5817e420/calendar-views.js/clean/calendar/base/content/calendar-views.js