rem: var start = item.startDate.jsDate; var end = item.endDate.jsDate;  var when = item.startDate + " -- " + item.endDate; dump(when+"\n"); var desc = item.description; if (desc == null) desc = ""; if (desc.length > 0) { if (desc.indexOf("\n ") >= 0 || desc.indexOf("\n\t") >= 0 || desc.indexOf(" ") == 0 || desc.indexOf("\t") == 0)    desc = "<PRE>"+desc+"</PRE>\n"; else  desc = "<P>"+desc.replace(/\n/g, "<BR>\n")+"</P>\n"; 
add:    var ev = <div class='vevent'/>;   ev.appendChild( <div> <div class='key summarykey'>Title</div> <div class='value summary'>{item.title}</div> </div> );   var startstr = new Object(); var endstr = new Object(); dateFormatter.formatInterval(item.startDate, item.endDate, startstr, endstr);    var seperator = ""; if (endstr.value) { seperator = " - "; 
context: function html_exportToStream(aStream, aCount, aItems) {    var str =         "<html>\n" +        "<head>\n" +         "<title>HTMLTitle</title>\n" +        "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n" +        "</head>\n"+ "<body bgcolor=\"#FFFFFF\" text=\"#000000\">\n";    aStream.write(str, str.length);       for each (item in aItems) {        try {            item = item.QueryInterface(Components.interfaces.calIEvent);        } catch(e) {            continue;        }        var start = item.startDate.jsDate;        var end = item.endDate.jsDate;        //var when = dateFormat.formatInterval(start, end, calendarEvent.allDay);        var when = item.startDate + " -- " + item.endDate;        dump(when+"\n");        var desc = item.description;        if (desc == null)          desc = "";        if (desc.length > 0) {           if (desc.indexOf("\n ") >= 0 || desc.indexOf("\n\t") >= 0 ||              desc.indexOf(" ") == 0 || desc.indexOf("\t") == 0)            // (RegExp /^[ \t]/ doesn't work.)            // contains indented preformatted text after beginning or newline            // so preserve indentation with PRE.            desc = "<PRE>"+desc+"</PRE>\n";          else            // no indentation, so preserve text line breaks in html with BR            desc = "<P>"+desc.replace(/\n/g, "<BR>\n")+"</P>\n";        }        // use div around each event so events are navigable via DOM.        str  = "<div><p>";        str += "<B>Title: </B>\t" + item.title + "<BR>\n";        str += "<B>When: </B>\t" + when.replace("--", "&ndash;") + "<BR>\n";        str += "<B>Where: </B>\t" + item.location + "<BR>\n";        // str += "<B>Organiser: </B>\t" + Event.???        str += "</p>\n";        str += desc; // may be empty        str += "</div>\n";        aStream.write(str, str.length);    }    str = "\n</body>\n</html>\n";    aStream.write(str, str.length);    return;};
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/bf0f4fc97ec7819dc65001fde0ea84e43b76c191/calHtmlExport.js/buggy/calendar/import-export/calHtmlExport.js