/**
* 지정일부터 작업전날까지.
* <pre>작업 전날 구하기.
* 1.그달 마지막일이 일요일이면 3일전까지
* 2.그달 마지막일이 토요일이면 2일전까지
* 3.그달 마지막일이 평일이면 1일전까지.
* </pre>
* @param currnetDate
* @return
*/
private boolean isWorkingDate(String currnetDate, int beginDay ) {
String currentDate = currnetDate.replaceAll("-","");
int year = Integer.parseInt(currentDate.substring(0,4));
int month = Integer.parseInt(currentDate.substring(4,6));
int day = Integer.parseInt(currentDate.substring(6,8));
int endDay;
Calendar cal = Calendar.getInstance();
cal.set(year, month-1, day );
int lastDayOfMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, lastDayOfMonth );
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
if( dayOfWeek == Calendar.SATURDAY ){
endDay=lastDayOfMonth-2;
}
else if( dayOfWeek == Calendar.SUNDAY ){
endDay=lastDayOfMonth-3;
}
else {
endDay=lastDayOfMonth-1;
}
return day >= beginDay && day <= endDay;
}
* 지정일부터 작업전날까지.
* <pre>작업 전날 구하기.
* 1.그달 마지막일이 일요일이면 3일전까지
* 2.그달 마지막일이 토요일이면 2일전까지
* 3.그달 마지막일이 평일이면 1일전까지.
* </pre>
* @param currnetDate
* @return
*/
private boolean isWorkingDate(String currnetDate, int beginDay ) {
String currentDate = currnetDate.replaceAll("-","");
int year = Integer.parseInt(currentDate.substring(0,4));
int month = Integer.parseInt(currentDate.substring(4,6));
int day = Integer.parseInt(currentDate.substring(6,8));
int endDay;
Calendar cal = Calendar.getInstance();
cal.set(year, month-1, day );
int lastDayOfMonth = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
cal.set(Calendar.DAY_OF_MONTH, lastDayOfMonth );
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
if( dayOfWeek == Calendar.SATURDAY ){
endDay=lastDayOfMonth-2;
}
else if( dayOfWeek == Calendar.SUNDAY ){
endDay=lastDayOfMonth-3;
}
else {
endDay=lastDayOfMonth-1;
}
return day >= beginDay && day <= endDay;
}