Managing Task Durations

Aspose.Tasks - Managing Durations

To manage durations using Aspose.Tasks Java for Ruby, simply invoke ManagingDuration module. Here you can see example code.

 1project = Rjb::import('com.aspose.tasks.Project').new
 2
 3task = project.getRootTask().getChildren().add("Task")
 4
 5tsk = Rjb::import('com.aspose.tasks.Tsk')
 6
 7duration = task.get(tsk.DURATION)
 8
 9puts "Duration in Days: " + duration.toString()
10
11duration = duration.convert(Rjb::import('com.aspose.tasks.TimeUnitType').Hour)
12
13puts "Duration in Hours: "+ duration.toString()
14
15task.set(tsk.DURATION, task.get(tsk.DURATION).subtract(0.5))
16
17puts "0.5 weeks: " + task.get(tsk.DURATION).toString()

Download Running Code

Download Managing Durations (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.