Retrieving Calendar Exceptions

Retrieving Calendar Exceptions The Calendar class returns the exceptions as a collection using the getExceptions() method. The getFromDate() and getToDate() methods exposed by CalendarException are used to retrieve dates for calendar exceptions. Both of these methods support the Date data type.

Programming Sample

The following example retrieves calendar exceptions.

 1// The path to the documents directory.
 2String dataDir = Utils.getDataDir(RetrieveCalendarExceptions.class);
 3
 4Project project = new Project(dataDir + "file.mpp");
 5
 6for(Calendar cal:project.getCalendars())
 7{
 8    for(CalendarException calExc: cal.getExceptions())
 9          {
10            System.out.println("From: " + calExc.getFromDate().toString()) ;
11            System.out.println("To: " + calExc.getToDate().toString()) ;
12      }
13}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.