Merge feadc46516c3 and 5d94f3f6efcc

This commit is contained in:
Heng Sin Low 2014-07-10 16:50:59 +08:00
commit f48169f81e
1 changed files with 14 additions and 0 deletions

View File

@ -815,4 +815,18 @@ public class TimeUtil
return endCal.get(Calendar.YEAR) * 12 + endCal.get(Calendar.MONTH)
- (startCal.get(Calendar.YEAR) * 12 + startCal.get(Calendar.MONTH));
}
/** Returns start date + nbDays which cannot be saturday or sunday or non business days */
public static Timestamp addOnlyBusinessDays(Timestamp startDate, int nbDays, int clientID, String trxName)
{
Timestamp retValue = startDate;
while (nbDays > 0) {
retValue = TimeUtil.addDays(retValue, 1);
StringBuilder sql = new StringBuilder("SELECT nextBusinessDay(?,?) FROM DUAL");
retValue = DB.getSQLValueTSEx(trxName, sql.toString(), retValue, clientID);
nbDays--;
}
return retValue;
}
} // TimeUtil