add:  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 ); }  
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 );            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 );               addEventsToCalendar( calendarEventArray );            }            break;            	 default:             alert("Unknown clipboard type: " + flavour.value);	 }      }   }   else     alert( "No iCalendar or text on the clipboard." );}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/76d8a17d218ab11924dcadac0133ee21a9ae4f8a/clipboard.js/buggy/calendar/resources/content/clipboard.js