Module: Asposetasksjava::CreateStandardCalendar

Defined in:
lib/asposetasksjava/Calendars/createstandardcalendar.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/asposetasksjava/Calendars/createstandardcalendar.rb', line 3

def initialize()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Instantiate project object
    project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp')

    # Define Calendar
	cal1 = project.getCalendars().add("My Cal")
	Rjb::import('com.aspose.tasks.Calendar').makeStandardCalendar(cal1)

	# Save the Project
	project.save(data_dir + "CreateStandardCalendar.xml", Rjb::import('com.aspose.tasks.SaveFileFormat').XML)

	puts "Created standard calendar, please check the output file."
end