Adding Calendar Exceptions in Ruby

Aspose.Tasks - Adding Calendar Exceptions

To add Calendar Exceptions using Aspose.Tasks Java for Ruby, simply invoke AddCalendarException module. Here you can see example code.

 1project = Rjb::import('com.aspose.tasks.Project').new('test_tasks.mpp')
 2cal = project.getCalendars().toList().get(0)
 3calException = Rjb::import('com.aspose.tasks.CalendarException').new
 4calObject = Rjb::import('java.util.Calendar').getInstance()
 5calObject.set(2009, 1, 1, 0, 0, 0)
 6calException.setFromDate(calObject.getTime())
 7calObject.set(2009, 1, 3, 0, 0, 0)
 8calException.setToDate(calObject.getTime())
 9cal.getExceptions().add(calException)
10puts "Added calendar exception."

Download Running Code

Download Adding Calendar Exceptions (Aspose.Tasks) from any of the below mentioned social coding sites:

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.