private int getWeekOfDate(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0){w = 0;}
return w;
}
private int getMonthOfDate(Date date){
Calendar cal = Calendar.getInstance();
cal.setTime(date);
int m = cal.get(Calendar.DAY_OF_MONTH);
return m;
}
private boolean belongCalendar(Date time, Date startTime, Date endTime) {
Calendar date = Calendar.getInstance();
date.setTime(time);
Calendar begin = Calendar.getInstance();
begin.setTime(startTime);
Calendar end = Calendar.getInstance();
end.setTime(endTime);
return date.after(begin) && date.before(end);
}