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')
 2
 3cal = project.getCalendars().toList().get(0)
 4
 5calException = Rjb::import('com.aspose.tasks.CalendarException').new
 6
 7calObject = Rjb::import('java.util.Calendar').getInstance()
 8
 9calObject.set(2009, 1, 1, 0, 0, 0)
10
11calException.setFromDate(calObject.getTime())
12
13calObject.set(2009, 1, 3, 0, 0, 0)
14
15calException.setToDate(calObject.getTime())
16
17cal.getExceptions().add(calException)
18
19puts "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.