code: public static CharSequence getJSDate(Calendar calendar)
  	{
  		StringBuilder dateJavascript = new StringBuilder();
  		dateJavascript.append("new Date(");
  		dateJavascript.append(calendar.get(Calendar.YEAR)).append(',');
  		dateJavascript.append(calendar.get(Calendar.MONTH)).append(',');
  		dateJavascript.append(calendar.get(Calendar.DAY_OF_MONTH)).append(',');
  		dateJavascript.append(calendar.get(Calendar.HOUR_OF_DAY)).append(',');
  		dateJavascript.append(calendar.get(Calendar.MINUTE)).append(',');
  		dateJavascript.append(calendar.get(Calendar.SECOND)).append(',');
  		dateJavascript.append(calendar.get(Calendar.MILLISECOND));
  		dateJavascript.append(')');
  
  		return dateJavascript.toString();
  	}
docs: Method to generate a javascript sequence to create an instance of date
  
  @param calendar
  Date to generate
  @return the javascript charsequence