Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Business calendar : BizCalendar SVO
 

BizCalendar SVO

For every due date calculation, an object of the class BizCalendar is created that accepts the start-time and duration. The BizCalendar object is then passed to the SBMCalendar.getDueDate(BizCalendar), for the due date calculation. This SVO is used to pass on the information to the SBMCalendar.getDueDate() method and is also used as a placeholder during the calculation.
BizCalendar also handles duration in string format such as "5d30m30s" using the specified Duration object.
Duration durObj = new Duration("5d30m30s");
long startDate = (new java.util.Date()).getTime();
    BizCalendar bcal = new BizCalendar(startDate, durObj);
    Calendar duedate = sbmcal.getDueDate(bcal);
BizCalendar supports duration with the formats YEAR(y), MONTH(m), DAY(d), HOUR(h), MINUTE(m), SECONDS(s). The Table 4 shows the use of these formats for Duration.
Table 4. Duration format usage
Duration format
Actual duration
1y10M25d5h30m3s
1 year, 10 months, 25 days, 5 hours, 30 minutes, 3 seconds
25d5h30m
25 days, 5 hours, 30 minutes
5h30m
5 hours, 30 minutes
5h
5 hours
30m
30 minutes
Duration dur = new Duration("1y10M25d5h30m3s");
long durval = dur.getTime();
This example returns 59635803000 milliseconds.