prevBusDate Method

Class: Date

Description

This method returns the previous business date that is the number of days prior to the specified date. For example, if the specified date is January 14, 2005 and the numberDays is 10, the previous business date is January 4, 2005 (assuming January 4 is a business day in the specified calendar).

Syntax

dateObject.prevBusDate(Number numberDays,String calendar)

Parameters

numberDays

The number of business days to subtract from the specified date. The default is 1.

calendar

The calendar name. The default is IBS.

Returns

A Date object that represents the date that is the specified number of days prior to the specified date (according to the specified business calendar).

When Became Available

Profile v7.0

Example

type RecordCIF cif = Db.getRecord("CIF","ACN=:ACN")

type Date date = cif.dob              // declare Date object

type String birthStr = date.month() _ "/" _ date.day()

if birthStr = "02/29",'(%SystemDate.isLeapYear()) do {

set birthStr="02/28"

}

set birthStr = birthStr _ "/" _ %SystemDate.year()

type Date birthday = birthStr.toDate()

type Date inviteAt = birthday.prevBusDay()

type Date invite1D = birthday.prevBusDay(1,"IBS")

 

* Variable ACN must be defined prior to the getRecord statement.