rem: var startDate = gCalendarWindow.currentView.getNewEventDate(); 
add: startDate = gCalendarWindow.currentView.getNewEventDate(); 
context: function pasteFromClipboard(){   const kClipboardIID = Components.interfaces.nsIClipboard;   if( canPaste() ) {         // 1. get the clipboard service      var clipboard = getClipboard();      // 2. create the transferable      var trans = createTransferable();        if ( trans && clipboard) {                              // 3. register the data flavors you want, highest fidelity first!         trans.addDataFlavor("text/calendar");         trans.addDataFlavor("text/unicode");         // 4. get transferable from clipboard	 clipboard.getData ( trans, kClipboardIID.kGlobalClipboard);	 // 5. ask transferable for the best flavor. Need to create new JS         //    objects for the out params.	 var flavour = { };	 var data = { };	 var length = { };	 trans.getAnyTransferData(flavour, data, length);	 data = data.value.QueryInterface(Components.interfaces.nsISupportsWString).data;	 //DEBUG alert("clipboard type: " + flavour.value);	 switch (flavour.value) {	 case "text/calendar":            var calendarEventArray;            calendarEventArray = parseIcalData( data );                        //change the date of all the events to now            var startDate = gCalendarWindow.currentView.getNewEventDate();            var MinutesToAddOn = gCalendarWindow.calendarPreferences.getPref( "defaulteventlength" );               var endDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );               for( var i = 0; i < calendarEventArray.length; i++ )            {               calendarEventArray[i].start.setTime( startDate );               calendarEventArray[i].end.setTime( endDateTime );            }            addEventsToCalendar( calendarEventArray );            break;	 case "text/unicode":            if ( data.indexOf("BEGIN:VEVENT") == -1 )            {               // no iCalendar data, paste clipboard text into description of new event                calendarEvent = createEvent();               initCalendarEvent( calendarEvent );               calendarEvent.description = data;               editNewEvent( calendarEvent );            }            else            {               var calendarEventArray;               calendarEventArray = parseIcalData( data );               //change the date of all the events to now               var startDate = gCalendarWindow.currentView.getNewEventDate();               var MinutesToAddOn = gCalendarWindow.calendarPreferences.getPref( "defaulteventlength" );                     var endDateTime = startDate.getTime() + ( 1000 * 60 * MinutesToAddOn );                     for( var i = 0; i < calendarEventArray.length; i++ )               {                  calendarEventArray[i].start.setTime( startDate );                  calendarEventArray[i].end.setTime( endDateTime );               }                              addEventsToCalendar( calendarEventArray );            }            break;            	 default:             alert("Unknown clipboard type: " + flavour.value);	 }      }   }   else     alert( "No iCalendar or text on the clipboard." );}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/75acdb4bf0058d6ccece89a6b346defe05cc319c/calendarClipboard.js/clean/calendar/resources/content/calendarClipboard.js