rem: calendarToDo.dueDate.jsDate = dueDate; 
add: calendarToDo.dueDate = jsDateToDateTime(startDate);  var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); var alarmsBranch = prefService.getBranch("calendar.alarms.");  if (alarmsBranch.getIntPref("onfortodos") == 1) {  calendarToDo.alarmTime = createDateTime();   if (!calendarToDo.entryDate) calendarToDo.entryDate = jsDateToDateTime( gCalendarWindow.currentView.getNewEventDate());  calendarToDo.setProperty("alarmUnits", alarmsBranch.getCharPref("todoalarmunit")); calendarToDo.setProperty("alarmLength", alarmsBranch.getIntPref("todoalarmlen")); calendarToDo.setProperty("alarmRelation", "START"); } 
context: function newToDo ( startDate, dueDate ) {    var calendarToDo = createToDo();       // created todo has no start or due date unless user wants one    if (startDate)         calendarToDo.entryTime.jsDate = startDate;    if (dueDate)        calendarToDo.dueDate.jsDate = dueDate;    var calendar = getSelectedCalendarOrNull();        editNewToDo(calendarToDo, calendar);}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/2f700ce9e591a5b6d46e2a72e67fd1d5d1b3aea0/calendar.js/buggy/calendar/resources/content/calendar.js