title: Format date output in a nonRendered xPage
body: <p>I am attempting to implement Julian Buss' terrific method of ical output as a non rendered xpage (<a href="http://blog.youatnotes.de/web/youatnotes/blog-jb.nsf/dx/how-to-implement-an-icalendar-feed-with-xpages.htm?opendocument&amp;comments" rel="nofollow">http://blog.youatnotes.de/web/youatnotes/blog-jb.nsf/dx/how-to-implement-an-icalendar-feed-with-xpages.htm?opendocument&amp;comments</a>). But I am unable to get the date to show up as a proper  ISO date format yyyymmdd</p>
  
  <p>I am getting my date from a notes view. Formatting the columns has no affect. I have tried various methods of formatting the date using javascript and failed.</p>
  
  <p>I am not sure if what I am doing is possible. If I should be looking at making the change to the Notes view. Or should I make the change in javascript?</p>
  
  <p>Also open to alternative methods of producing an ics file from a notes database.</p>
  
  <p>Here is the code from my non rendered xpage</p>
  
  <pre><code>&lt;xp:this.afterRenderResponse&gt;&lt;![CDATA[#{javascript:var exCon = facesContext.getExternalContext(); 
  var writer = facesContext.getResponseWriter(); 
  var response = exCon.getResponse(); 
  var nview:NotesView = database.getView("ical"); 
  nview.setAutoUpdate(false); 
  var vc:NotesViewEntryCollection = nview.getAllEntries(); 
   var ve:NotesViewEntry = vc.getFirstEntry(); 
  var values; 
  var date; 
  var body; 
  var period; 
  var i = 0; 
  response.setContentType("text/calendar"); 
  response.setHeader("Cache-Control", "no-cache"); 
  writer.write("BEGIN:VCALENDAR\r\n"); 
  writer.write("VERSION:2.0\r\n"); 
  writer.write("X-LOTUS-CHARSET:UTF-8\r\n"); 
  while (ve) { 
          values = ve.getColumnValues(); 
        date = ve.getColumnValues()[1];
      edate = ve.getColumnValues()[2];
      body = values.elementAt(3); 
      period = values.elementAt(2); 
      writer.write("BEGIN:VEVENT\r\n"); 
      writer.write("DTSTART:"+date+"T080000\r\n"); 
      writer.write("DTEND:"+edate+"T080000\r\n"); 
      writer.write("DESCRIPTION:"+body+"\r\n"); 
      writer.write("END:VEVENT\r\n"); 
      ve = vc.getNextEntry(ve); }    writer.write("END:VCALENDAR\r\n"); 
  writer.endDocument(); }]]&gt;&lt;/xp:this.afterRenderResponse&gt;
  </code></pre>
  
  <p>This is the output from an event</p>
  
  <pre><code>BEGIN:VEVENT
  DTSTART:08/12/2004T080000
  DTEND:08/13/2004T080000
  DESCRIPTION:Patrick Sawyer: Out of Office
  END:VEVENT 
  </code></pre>