try {
fromDate = dFormat.parse("2008-10-31 16:10");
} catch (ParseException ex) {
Logger.getLogger(TestCalendarService.class.getName()).log(Level.SEVERE, null, ex);
}
Duration du = new Duration(2,Duration.DAY);
du.setBusinessTime(true);
Date newDate = calService.dateAfter(fromDate, du);
System.out.println("2 biz day after 2008-10-31 16:10 is "+dFormat.format(newDate));
//
Duration du2 = new Duration(3, Duration.HOUR);
du2.setBusinessTime(true);
Date newDate2 = calService.dateAfter(fromDate, du2);
System.out.println("3 biz hour after 2008-10-31 16:10 is " + dFormat.format(newDate2));
//
Duration du3 = new Duration(1,Duration.WEEK);
du3.setBusinessTime(false);
Date newDate3 = calService.dateAfter(fromDate, du3);
System.out.println("1week after 2008-10-31 16:10 is "+dFormat.format(newDate3));
//
//
Duration du4 = new Duration(1,Duration.YEAR);
du4.setBusinessTime(false);
Date newDate4 = calService.dateAfter(fromDate, du4);
System.out.println("1 year after 2008-10-31 10:10 is "+dFormat.format(newDate4));
//
Date t2 = new Date();
System.out.println("cal time is " + (t2.getTime() - t1.getTime()));