3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/asposetasksjava/Calendars/defineweekdaysforexceptions.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp')
cal = project.getCalendars().add("Calendar1")
except = Rjb::import('com.aspose.tasks.CalendarException').new
except.setEnteredByOccurrences(false)
cal_object = Rjb::import('java.util.Calendar').getInstance()
cal_object.set(2009, 12, 24, 0, 0, 0)
except.setFromDate(cal_object.getTime())
cal_object.set(2009, 12, 31, 23, 59, 0)
except.setToDate(cal_object.getTime())
except.setType(Rjb::import('com.aspose.tasks.CalendarExceptionType').Daily)
except.setDayWorking(false)
cal.getExceptions().add(except)
puts "Defined weekdays for exceptions."
end
|