IDEMPIERE-2072 get number of non business days between 2 dates / fix NPE
This commit is contained in:
parent
c1fe36259a
commit
1e85ef81ad
|
@ -866,7 +866,7 @@ public class TimeUtil
|
||||||
calEnd.set(Calendar.MILLISECOND, 0);
|
calEnd.set(Calendar.MILLISECOND, 0);
|
||||||
|
|
||||||
while (cal.before(calEnd) || cal.equals(calEnd)) {
|
while (cal.before(calEnd) || cal.equals(calEnd)) {
|
||||||
if (!nbd.contains(new Timestamp(cal.getTimeInMillis()))) {
|
if (nbd == null || !nbd.contains(new Timestamp(cal.getTimeInMillis()))) {
|
||||||
if (cal.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && cal.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
|
if (cal.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && cal.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) {
|
||||||
retValue++;
|
retValue++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue