Here you can find the source of isHoliday(Date date, String[] excludes, String[] includes)
public static boolean isHoliday(Date date, String[] excludes, String[] includes)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isHoliday(Date date, String[] excludes, String[] includes) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMdd"); if (date == null) { date = new Date(); }// w w w .j ava2 s . c o m Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int week = calendar.get(Calendar.DAY_OF_WEEK); String today = simpleDateFormat.format(calendar.getTime()); if (week == 1 || week == 7) { if (excludes != null) { for (int i = 0, len = excludes.length; i < len; ++i) { if (today.equals(excludes[i])) { return false; } } } return true; } else { if (includes != null) { for (int i = 0, len = includes.length; i < len; ++i) { if (today.equals(includes[i])) { return true; } } } return false; } } }