Defining Weekdays for Exceptions in Ruby

Aspose.Tasks - Defining Weekdays for Exceptions

To Define Weekdays for Exceptions using Aspose.Tasks Java for Ruby, simply invoke DefineWeekdaysForExceptions module. Here you can see example code.

 1project = Rjb::import('com.aspose.tasks.Project').new('test_tasks.mpp')
 2cal = project.getCalendars().add("Calendar1")
 3except = Rjb::import('com.aspose.tasks.CalendarException').new
 4except.setEnteredByOccurrences(false)
 5cal_object = Rjb::import('java.util.Calendar').getInstance()
 6cal_object.set(2009, 12, 24, 0, 0, 0)
 7except.setFromDate(cal_object.getTime())
 8cal_object.set(2009, 12, 31, 23, 59, 0)
 9except.setToDate(cal_object.getTime())
10except.setType(Rjb::import('com.aspose.tasks.CalendarExceptionType').Daily)
11except.setDayWorking(false)
12cal.getExceptions().add(except)
13puts "Defined weekdays for exceptions."

Download Running Code

Download Defining Weekdays for 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.