rem: while (lineIndex < totalLines) { var fields = lines[lineIndex].split('","'); ++lineIndex; if (fields.length < 5) continue;  fields[0] = fields[0].substring(1); var title = fields[0];  var sdate = formater.parseShortDate(fields[1]+" "+fields[2]); var edate = formater.parseShortDate(fields[3]+" "+fields[4]); if ((sdate != null) && (edate != null)) { exists = entryExists(sdate, title); calendarEvent = createEvent(); calendarEvent.id = createUniqueID(); calendarEvent.title = title; calendarEvent.start.setTime(sdate); calendarEvent.end.setTime(edate); if ( !exists ) eventArray[ eventArray.length ] = calendarEvent; else dupArray[ dupArray.length ] = calendarEvent; 
add: if(eventFields != null) {  sDate = formater.parseShortDate(eventFields[2] + " " + eventFields[3]); eDate = formater.parseShortDate(eventFields[4] + " " + eventFields[5]);  if ((sDate != null) && (eDate != null)) { alarmDate = formater.parseShortDate(eventFields[8] + " " + eventFields[9]);  calendarEvent = createEvent(); calendarEvent.id = createUniqueID(); calendarEvent.title = eventFields[1]; calendarEvent.description = eventFields[23]; calendarEvent.location = eventFields[25]; calendarEvent.start.setTime(sDate); calendarEvent.end.setTime(eDate); calendarEvent.allDay = (eventFields[6] == "True"); calendarEvent.privateEvent = (eventFields[29] == "True"); calendarEvent.categories = eventFields[21]; calendarEvent.alarm = (eventFields[7] == "True"); calendarEvent.alarmLength = Math.round((sDate - alarmDate)/kDate_MillisecondsInMinute); calendarEvent.alarmUnits = "minutes"; calendarEvent.setParameter("ICAL_RELATED_PARAMETER", "ICAL_RELATED_START");  if (entryExists(sDate, calendarEvent.title)) dupArray[ dupArray.length ] = calendarEvent; else eventArray[ eventArray.length ] = calendarEvent; } 
context: function parseOutlookCSVData( icalStr, discardDuplicates, promptEach ){  var lines = icalStr.split("\n");  var calendarEvent;  var eventArray = new Array();  var dupArray = new Array();  var lineIndex = 1;  var totalLines = lines.length-1;  var exists = false;  var formater = new DateFormater();     while (lineIndex < totalLines) {    var fields = lines[lineIndex].split('","');    ++lineIndex;    if (fields.length < 5)      continue;          fields[0] = fields[0].substring(1); // strip off the leading quote...    var title = fields[0];    //parseShortDate magically decides the format (locale) of dates/times    var sdate = formater.parseShortDate(fields[1]+" "+fields[2]);    var edate = formater.parseShortDate(fields[3]+" "+fields[4]);    if ((sdate != null) && (edate != null)) {      exists = entryExists(sdate, title);      calendarEvent = createEvent();      calendarEvent.id = createUniqueID();      calendarEvent.title = title;      calendarEvent.start.setTime(sdate);      calendarEvent.end.setTime(edate);      if ( !exists )        eventArray[ eventArray.length ] = calendarEvent;      else        dupArray[ dupArray.length ] = calendarEvent;    }  }//   dump("*** calendar entries : " + eventArray.length + "\n");//   dump("*** duplicate entries: " + dupArray.length + "\n");  return { calendarEventArray: eventArray, calendarDuplicateArray: dupArray };}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/5ddeec6f269b076c13c815ec393a38a24ff0bc4f/importExport.js/clean/calendar/resources/content/importExport.js